env customizable host
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
# Server Configuration
|
# Server Configuration
|
||||||
|
HOST="localhost"
|
||||||
PORT=3000
|
PORT=3000
|
||||||
NODE_ENV=development
|
NODE_ENV=development
|
||||||
|
|
||||||
|
|||||||
@@ -52,13 +52,12 @@ async function bootstrap() {
|
|||||||
const document = SwaggerModule.createDocument(app, config);
|
const document = SwaggerModule.createDocument(app, config);
|
||||||
SwaggerModule.setup('api', app, document);
|
SwaggerModule.setup('api', app, document);
|
||||||
|
|
||||||
|
const host = process.env.HOST ?? 'localhost';
|
||||||
const port = process.env.PORT ?? 3000;
|
const port = process.env.PORT ?? 3000;
|
||||||
await app.listen(port);
|
await app.listen(port);
|
||||||
|
|
||||||
logger.log(`Application is running on: http://localhost:${port}`);
|
logger.log(`Application is running on: http://${host}:${port}`);
|
||||||
logger.log(
|
logger.log(`Swagger documentation available at: http://${host}:${port}/api`);
|
||||||
`Swagger documentation available at: http://localhost:${port}/api`,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void bootstrap();
|
void bootstrap();
|
||||||
|
|||||||
Reference in New Issue
Block a user