mirror of
https://github.com/turt2live/matrix-dimension.git
synced 2024-10-01 01:05:53 -04:00
Serve static content correctly
This commit is contained in:
parent
f6ec58e9d2
commit
84f3977fd4
@ -35,10 +35,13 @@ export default class Webserver {
|
|||||||
|
|
||||||
// We register the default route last to make sure we don't override anything by accident.
|
// We register the default route last to make sure we don't override anything by accident.
|
||||||
// We'll pass off all other requests to the web app
|
// We'll pass off all other requests to the web app
|
||||||
this.app.get("*", (_req, res) => {
|
this.app.get(/(widgets\/|riot\/|\/)*/, (_req, res) => {
|
||||||
res.sendFile(path.join(__dirname, "..", "..", "web", "index.html"));
|
res.sendFile(path.join(__dirname, "..", "..", "web", "index.html"));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Register the static content last
|
||||||
|
this.app.use(express.static(path.join(__dirname, "..", "..", "web")));
|
||||||
|
|
||||||
// Set up the error handler
|
// Set up the error handler
|
||||||
this.app.use((err: any, _req, res, next) => {
|
this.app.use((err: any, _req, res, next) => {
|
||||||
if (err instanceof ApiError) {
|
if (err instanceof ApiError) {
|
||||||
|
Loading…
Reference in New Issue
Block a user