Fix CORS issues
This commit is contained in:
parent
44d045f546
commit
f1198de337
1 changed files with 10 additions and 1 deletions
11
app.js
11
app.js
|
@ -29,7 +29,16 @@ app.get('/mode', (req, res) => {
|
|||
app.use(actuator()); // Provides /health, /metrics, /info
|
||||
|
||||
// The web frontend
|
||||
app.use(express.static(__dirname + '/node_modules/@actual-app/web/build'));
|
||||
app.use((req, res, next) => {
|
||||
res.set('Cross-Origin-Opener-Policy', 'same-origin');
|
||||
res.set('Cross-Origin-Embedder-Policy', 'require-corp');
|
||||
next();
|
||||
});
|
||||
app.use(
|
||||
express.static(__dirname + '/node_modules/@actual-app/web/build', {
|
||||
index: false
|
||||
})
|
||||
);
|
||||
app.get('/*', (req, res) => {
|
||||
res.sendFile(__dirname + '/node_modules/@actual-app/web/build/index.html');
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue