Updates
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import isDevelopment from "../../../utils/is-development";
|
||||
import genWebHTML from "./generate-web-html";
|
||||
import grabPageComponent from "./grab-page-component";
|
||||
|
||||
@@ -24,11 +25,24 @@ export default async function ({ req }: Params): Promise<Response> {
|
||||
// pageProps: serverRes,
|
||||
// });
|
||||
|
||||
return new Response(html, {
|
||||
const res_opts: ResponseInit = {
|
||||
headers: {
|
||||
"Content-Type": "text/html",
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
if (isDevelopment()) {
|
||||
res_opts.headers = {
|
||||
...res_opts.headers,
|
||||
"Cache-Control": "no-cache, no-store, must-revalidate",
|
||||
Pragma: "no-cache",
|
||||
Expires: "0",
|
||||
};
|
||||
}
|
||||
|
||||
const res = new Response(html, res_opts);
|
||||
|
||||
return res;
|
||||
} catch (error: any) {
|
||||
return new Response(error.message || `Page Not Found`, {
|
||||
status: 404,
|
||||
|
||||
Reference in New Issue
Block a user