diff --git a/src/lib/app.ts b/src/lib/app.ts index fad34a65f2..a49f979296 100644 --- a/src/lib/app.ts +++ b/src/lib/app.ts @@ -201,6 +201,7 @@ export default async function getApp( } app.get(`${baseUriPath}`, (req, res) => { + res.set('Content-Type', 'text/html'); res.send(indexHTML); }); @@ -214,6 +215,14 @@ export default async function getApp( }); app.get(`${baseUriPath}/*`, (req, res) => { + res.set('Content-Type', 'text/html'); + const requestPath = path.parse(req.url); + // appropriately return 404 requests for assets with an extension (js, css, etc) + if (requestPath.ext !== '' && requestPath.ext !== 'html') { + res.set('Cache-Control', 'no-cache'); + res.status(404).send(indexHTML); + return; + } res.send(indexHTML); });