Skip checking DIST_ROOT twice

f0cd1592 did an additional call instead of replacement.

Aside: the 1 hour value only has effect in dev instances. For prod, CloudFlare seems to override that to 4 hours.
This commit is contained in:
infinite-persistence 2022-01-05 14:23:33 +08:00 committed by Thomas Zarebczan
parent 6583b6a636
commit c6fb204d11

View file

@ -33,7 +33,5 @@ app.use(serve(DIST_ROOT, {
maxage: 3600000, // set a cache time of one hour, helpful for mobile dev maxage: 3600000, // set a cache time of one hour, helpful for mobile dev
})); }));
app.use(serve(DIST_ROOT)); // Check if the request url matches any assets inside of /dist
app.use(router.routes()); app.use(router.routes());
app.listen(config.WEB_SERVER_PORT, () => `Server up at localhost:${config.WEB_SERVER_PORT}`); app.listen(config.WEB_SERVER_PORT, () => `Server up at localhost:${config.WEB_SERVER_PORT}`);