File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,9 @@ app.use(
1616 credentials : true ,
1717 } ) ,
1818) ;
19- app . use ( express . static ( path . join ( __dirname , "./build" ) ) ) ;
19+ if ( process . env . NODE_ENV === "production" ) {
20+ app . use ( express . static ( path . join ( __dirname , "./build" ) ) ) ;
21+ }
2022
2123app . use ( bodyParser . json ( { limit : "50mb" } ) ) ; //limit limits the data which can be uploaded to server.js from frontend
2224const store = new MongoDBStore ( {
@@ -43,7 +45,9 @@ app.use(
4345) ;
4446
4547app . get ( "/" , cors ( ) , ( req , res ) => {
46- res . sendFile ( path . join ( __dirname , "./build" , "index.html" ) ) ;
48+ if ( process . env . NODE_ENV === "production" ) {
49+ res . sendFile ( path . join ( __dirname , "./build" , "index.html" ) ) ;
50+ }
4751} ) ;
4852
4953app . use ( "/en" , approute ) ; //routing to all functions
You can’t perform that action at this time.
0 commit comments