File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
vercel-functions/prerender/_prerender-ember-route.func Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -31,17 +31,14 @@ export default async function prerenderEmberRoute(request, response) {
31
31
// Parse status code
32
32
const statusCode = result . _fastbootInfo . response . statusCode ;
33
33
34
- // Redirect to 404 page if the status code is not 200
34
+ // Render a generic page if the status code is not 200
35
35
if ( statusCode !== 200 ) {
36
36
console . warn ( 'FastBoot response statusCode was:' , statusCode ) ;
37
- response . redirect ( '/404' ) ;
37
+ response . send ( fs . readFileSync ( 'dist/_empty.html' , 'utf-8' ) ) ;
38
38
39
39
return ;
40
40
}
41
41
42
- // Get the HTML content of the FastBoot response
43
- const html = await result [ 'html' ] ( ) ; // Weird VSCode syntax highlighting issue if written as result.html()
44
-
45
- // Send the HTML content as result
46
- response . send ( html ) ;
42
+ // Get the HTML content of the FastBoot response & send it as result
43
+ response . send ( await result . html ( ) ) ;
47
44
}
You can’t perform that action at this time.
0 commit comments