File tree Expand file tree Collapse file tree 2 files changed +5
-17
lines changed Expand file tree Collapse file tree 2 files changed +5
-17
lines changed Original file line number Diff line number Diff line change @@ -64,16 +64,10 @@ const createApp = async () => {
64
64
app . use ( express . json ( ) ) ;
65
65
app . use ( express . urlencoded ( { extended : true } ) ) ;
66
66
app . use ( '/' , routes ) ;
67
-
68
- // In production, serves the static files from the build directory
69
- if ( process . env . NODE_ENV === 'production' ) {
70
- app . use ( '/' , express . static ( absBuildPath ) ) ;
71
- app . get ( '/*' , ( req , res ) => {
72
- res . sendFile ( path . join ( `${ absBuildPath } /index.html` ) ) ;
73
- } ) ;
74
- } else {
75
- console . log ( 'Not serving static files' ) ;
76
- }
67
+ app . use ( '/' , express . static ( absBuildPath ) ) ;
68
+ app . get ( '/*' , ( req , res ) => {
69
+ res . sendFile ( path . join ( `${ absBuildPath } /index.html` ) ) ;
70
+ } ) ;
77
71
78
72
return app ;
79
73
} ;
Original file line number Diff line number Diff line change @@ -3,13 +3,7 @@ const router = new express.Router();
3
3
const passport = require ( '../passport' ) . getPassport ( ) ;
4
4
const db = require ( '../../db' ) ;
5
5
const passportType = passport . type ;
6
- const { GIT_PROXY_UI_HOST : uiHost = 'http://localhost' , NODE_ENV } = process . env ;
7
-
8
- // TODO: Refactor this through proper .env loading. This handles redirects in dev.
9
- let uiPort = 3000 ;
10
- if ( NODE_ENV === 'production' ) {
11
- uiPort = process . env . GIT_PROXY_UI_PORT ;
12
- }
6
+ const { GIT_PROXY_UI_HOST : uiHost = 'http://localhost' , GIT_PROXY_UI_PORT : uiPort = 3000 } = process . env ;
13
7
14
8
router . get ( '/' , ( req , res ) => {
15
9
res . status ( 200 ) . json ( {
You can’t perform that action at this time.
0 commit comments