Skip to content

Commit a9d6073

Browse files
committed
[Update] mapping swagger url host to env value #16
1 parent 166876c commit a9d6073

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/app/main.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ dotenv.config({ path: '../../config/.server.env' });
99

1010
const app = express();
1111
const PORT = process.env.PORT || 8000;
12+
const HOST_ADDRESS = process.env.HOST_ADDRESS || 'localhost'
1213

1314
const swaggerSpec = YAML.load(path.join(__dirname, './swagger.yaml'));
1415
const portInjectedSwaggerSpec = JSON.stringify(swaggerSpec).replace(
1516
'{PORT}',
1617
PORT.toString()
17-
);
18+
).replace('{HOST_ADDRESS}', HOST_ADDRESS);
1819

1920
import visitor from './src/apis/visitor';
2021

0 commit comments

Comments
 (0)