File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -46,17 +46,16 @@ if (process.env.BASIC_USERNAME && process.env.BASIC_PASSWORD) {
4646 } ) ) ;
4747}
4848
49- const corsOriginsWhitelist = [
49+ const allowedCorsOrigins = [
5050 / p 5 j s \. o r g $ / ,
51+ / l o c a l h o s t / // to allow client-only development
5152] ;
5253
5354// Run Webpack dev server in development mode
5455if ( process . env . NODE_ENV === 'development' ) {
5556 const compiler = webpack ( config ) ;
5657 app . use ( webpackDevMiddleware ( compiler , { noInfo : true , publicPath : config . output . publicPath } ) ) ;
5758 app . use ( webpackHotMiddleware ( compiler ) ) ;
58-
59- corsOriginsWhitelist . push ( / l o c a l h o s t / ) ;
6059}
6160
6261const mongoConnectionString = process . env . MONGO_URL ;
@@ -65,7 +64,7 @@ app.set('trust proxy', true);
6564// Enable Cross-Origin Resource Sharing (CORS) for all origins
6665const corsMiddleware = cors ( {
6766 credentials : true ,
68- origin : corsOriginsWhitelist ,
67+ origin : allowedCorsOrigins ,
6968} ) ;
7069app . use ( corsMiddleware ) ;
7170// Enable pre-flight OPTIONS route for all end-points
You can’t perform that action at this time.
0 commit comments