add manual set Access Control Allow Origin header
This commit is contained in:
parent
baec2baf98
commit
be3fa1ecb9
1 changed files with 5 additions and 0 deletions
|
@ -28,6 +28,11 @@ const corsOptions = {
|
||||||
|
|
||||||
app.options('*', cors(corsOptions));
|
app.options('*', cors(corsOptions));
|
||||||
app.use('*', 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
|
// disable logging for tests
|
||||||
if (process.env.NODE_ENV !== 'test') app.use(logger('dev'));
|
if (process.env.NODE_ENV !== 'test') app.use(logger('dev'));
|
||||||
|
|
Loading…
Reference in a new issue