naslovnica: express.static je sam postregel index.html, zato SSR handler ni prisel do besede (index: false)
This commit is contained in:
@@ -129,6 +129,9 @@ export function serveStatic(app: Express) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
app.use(express.static(distPath, {
|
app.use(express.static(distPath, {
|
||||||
|
// brez tega express.static sam postrezhe index.html za "/" in nasa
|
||||||
|
// naslovnica nikoli ne pride do handlerja, ki ji doda strukturirane podatke
|
||||||
|
index: false,
|
||||||
setHeaders(res, filePath) {
|
setHeaders(res, filePath) {
|
||||||
if (filePath.endsWith("og-image.jpg") || filePath.includes("/uploads/") || filePath.includes("/images/")) {
|
if (filePath.endsWith("og-image.jpg") || filePath.includes("/uploads/") || filePath.includes("/images/")) {
|
||||||
res.setHeader("Cache-Control", "public, max-age=86400");
|
res.setHeader("Cache-Control", "public, max-age=86400");
|
||||||
|
|||||||
Reference in New Issue
Block a user