File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -43,12 +43,14 @@ app.use('/api/auth', authRouter);
43
43
app . use ( '/api/likes' , likeRouter ) ;
44
44
app . use ( '/api/notifications' , notificationRouter ) ;
45
45
46
- app . get ( '*' , ( _req , res ) => {
47
- const prodPath = path . join ( __dirname , 'index.html' ) ;
48
- const devPath = path . join ( __dirname , '..' , 'build' , 'index.html' ) ;
46
+ if ( NODE_ENV === ( 'production' || 'development' ) ) {
47
+ app . get ( '*' , ( _req , res ) => {
48
+ const prodPath = path . join ( __dirname , 'index.html' ) ;
49
+ const devPath = path . join ( __dirname , '..' , 'build' , 'index.html' ) ;
49
50
50
- res . sendFile ( NODE_ENV === 'production' ? prodPath : devPath ) ;
51
- } ) ;
51
+ res . sendFile ( NODE_ENV === 'production' ? prodPath : devPath ) ;
52
+ } ) ;
53
+ }
52
54
53
55
if ( NODE_ENV !== 'production' ) {
54
56
app . use ( '/api/test' , testRouter ) ;
You can’t perform that action at this time.
0 commit comments