Skip to content

Commit

Permalink
allow CORS requests for dist/ and scenes/
Browse files Browse the repository at this point in the history
  • Loading branch information
sdumetz committed May 15, 2024
1 parent cd9ca36 commit 66b21f6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions source/server/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ export default async function createServer(config = defaultConfig) :Promise<expr
next();
});

//Allow CORS for assets that might get embedded
app.use(["/dist", "/scenes"], (req, res, next)=>{
res.set("Access-Control-Allow-Origin", "*");
next();
});

app.use("/ui/scenes/:scene/", canRead);

app.get("/ui/scenes/:scene/view", (req, res)=>{
Expand Down

0 comments on commit 66b21f6

Please sign in to comment.