mirror of
https://github.com/turt2live/matrix-dimension.git
synced 2024-09-15 05:22:13 +00: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'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"));
|
||||
});
|
||||
|
||||
// Register the static content last
|
||||
this.app.use(express.static(path.join(__dirname, "..", "..", "web")));
|
||||
|
||||
// Set up the error handler
|
||||
this.app.use((err: any, _req, res, next) => {
|
||||
if (err instanceof ApiError) {
|
||||
|
Loading…
Reference in New Issue
Block a user