@@ -15,6 +15,7 @@ const SWA_CLI_PORT = parseInt(process.env.SWA_CLI_PORT || "", 10);
1515const SWA_CLI_APP_URI = buildAdress ( SWA_CLI_HOST , process . env . SWA_CLI_APP_PORT ) ;
1616const SWA_CLI_API_URI = buildAdress ( SWA_CLI_HOST , process . env . SWA_CLI_API_PORT ) ;
1717const SWA_CLI_AUTH_URI = buildAdress ( SWA_CLI_HOST , process . env . SWA_CLI_AUTH_PORT ) ;
18+ const SWA_CLI_APP_ARTIFACT_LOCATION = process . env . SWA_CLI_APP_ARTIFACT_LOCATION ;
1819
1920if ( ! isHttpUrl ( SWA_CLI_APP_URI ) ) {
2021 console . log ( `The provided app URI is not a valid` ) ;
@@ -56,7 +57,6 @@ const serveStatic = (file: string, res: http.ServerResponse, status = 200) => {
5657 res . end ( JSON . stringify ( err ) ) ;
5758 return ;
5859 }
59- console . log ( "serving" , file ) ;
6060 res . writeHead ( status ) ;
6161 res . end ( data ) ;
6262 } ) ;
@@ -84,7 +84,7 @@ const readRoutes = (folder: string): UserDefinedRoute[] => {
8484 return require ( path . join ( folder , routesFile ) ) . routes || [ ] ;
8585} ;
8686
87- const routes = readRoutes ( process . env . SWA_CLI_APP_ARTIFACT_LOCATION || "" ) ;
87+ const routes = readRoutes ( SWA_CLI_APP_ARTIFACT_LOCATION || "" ) ;
8888
8989const routeTest = ( userDefinedRoute : string , currentRoute : string ) => {
9090 if ( userDefinedRoute === currentRoute ) {
@@ -185,7 +185,7 @@ const server = http.createServer(function (req, res) {
185185 // detected SPA mode
186186 else if ( req . url . startsWith ( "/?" ) ) {
187187 console . log ( "proxy>" , req . method , req . headers . host + req . url ) ;
188- const fileIndex = path . join ( process . env . SWA_CLI_APP_ARTIFACT_LOCATION || "" , "index.html" ) ;
188+ const fileIndex = path . join ( SWA_CLI_APP_ARTIFACT_LOCATION || "" , "index.html" ) ;
189189 serveStatic ( fileIndex , res ) ;
190190 }
191191
0 commit comments