File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -4,9 +4,19 @@ const debugMode = Array.from(process.argv.map((arg) => arg.trim().toLowerCase())
44const logger = require ( '../modules/Logger' ) ( debugMode ) ;
55const eventManager = ( require ( '../modules/singletons/EventManager.js' ) ) . instance ;
66const cors = require ( 'cors' ) ;
7- const { CORS_OPTIONS , CONTENT_TYPE_VALIDATOR } = require ( '../config/globals' ) ;
7+ const { CONTENT_TYPE_VALIDATOR } = require ( '../config/globals' ) ;
88
9- router . use ( cors ( CORS_OPTIONS ) ) ;
9+ router . use ( cors (
10+ ( process . env . NODE_ENV ?. trim ( ) === 'development'
11+ ? {
12+ origin : '*' ,
13+ optionsSuccessStatus : 200
14+ }
15+ : {
16+ origin : 'http://localhost:3000' ,
17+ optionsSuccessStatus : 200
18+ } )
19+ ) ) ;
1020
1121router . post ( '/sockets/broadcast' , ( req , res , next ) => {
1222 CONTENT_TYPE_VALIDATOR ( req , res , next ) ;
You can’t perform that action at this time.
0 commit comments