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 () => {
6464 app . use ( express . json ( ) ) ;
6565 app . use ( express . urlencoded ( { extended : true } ) ) ;
6666 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+ } ) ;
7771
7872 return app ;
7973} ;
Original file line number Diff line number Diff line change @@ -3,13 +3,7 @@ const router = new express.Router();
33const passport = require ( '../passport' ) . getPassport ( ) ;
44const db = require ( '../../db' ) ;
55const 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 ;
137
148router . get ( '/' , ( req , res ) => {
159 res . status ( 200 ) . json ( {
You can’t perform that action at this time.
0 commit comments