add manual set Access Control Allow Origin header

This commit is contained in:
Sorrel Bri 2020-01-18 01:30:15 -08:00 committed by sorrelbri
parent 4960a5f60d
commit 63b95b0604

View file

@ -28,6 +28,11 @@ const corsOptions = {
app.options('*', cors(corsOptions));
app.use('*', cors(corsOptions));
app.use((req, res, next) => {
res.header("Access-Control-Allow-Origin", allowedOrigin);
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
next();
});
// disable logging for tests
if (process.env.NODE_ENV !== 'test') app.use(logger('dev'));