Open nosshar opened 2 years ago
This fallback route fires on each request: https://github.com/turt2live/matrix-dimension/blob/147a53640225ff3d34b1ab3ce367cd8c9b06eaf7/src/api/Webserver.ts#L43
It can be rewritten as:
this.app.get(/(widgets\/|riot\/|element\/|\/)*/, (_req, res) => { if (!res.headersSent) { res.sendFile(path.join(__dirname, "..", "..", "web", "index.html")); } });
There is no need to return the contents of index.html if something hadled the request earlier. Not an experienced user of ExpressJS though, but got application working (stikcers at least) without annoying error.
This fallback route fires on each request: https://github.com/turt2live/matrix-dimension/blob/147a53640225ff3d34b1ab3ce367cd8c9b06eaf7/src/api/Webserver.ts#L43
It can be rewritten as:
There is no need to return the contents of index.html if something hadled the request earlier. Not an experienced user of ExpressJS though, but got application working (stikcers at least) without annoying error.