File tree 1 file changed +3
-4
lines changed
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) {
46
46
} ) ) ;
47
47
}
48
48
49
- const corsOriginsWhitelist = [
49
+ const allowedCorsOrigins = [
50
50
/ p 5 j s \. o r g $ / ,
51
+ / l o c a l h o s t / // to allow client-only development
51
52
] ;
52
53
53
54
// Run Webpack dev server in development mode
54
55
if ( process . env . NODE_ENV === 'development' ) {
55
56
const compiler = webpack ( config ) ;
56
57
app . use ( webpackDevMiddleware ( compiler , { noInfo : true , publicPath : config . output . publicPath } ) ) ;
57
58
app . use ( webpackHotMiddleware ( compiler ) ) ;
58
-
59
- corsOriginsWhitelist . push ( / l o c a l h o s t / ) ;
60
59
}
61
60
62
61
const mongoConnectionString = process . env . MONGO_URL ;
@@ -65,7 +64,7 @@ app.set('trust proxy', true);
65
64
// Enable Cross-Origin Resource Sharing (CORS) for all origins
66
65
const corsMiddleware = cors ( {
67
66
credentials : true ,
68
- origin : corsOriginsWhitelist ,
67
+ origin : allowedCorsOrigins ,
69
68
} ) ;
70
69
app . use ( corsMiddleware ) ;
71
70
// Enable pre-flight OPTIONS route for all end-points
You can’t perform that action at this time.
0 commit comments