Skip to content

Commit

Permalink
refactor(api): using env.server.host variable
Browse files Browse the repository at this point in the history
  • Loading branch information
xmlking committed Nov 22, 2018
1 parent 59967f1 commit 74b19c4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions apps/api/src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ export const environment = {
NODE_TLS_REJECT_UNAUTHORIZED: 0,

server: {
host: 'localhost',
domainUrl: 'http://localhost:3000',
port: 3000,
host: process.env.HOST || '0.0.0.0',
domainUrl: process.env.DOMAIN_URL || 'http://localhost:3000',
port: process.env.PORT || 3000,
globalPrefix: '/api',
},

Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const environment = {
LOG_LEVEL: 'debug',

server: {
host: 'localhost',
host: '0.0.0.0',
domainUrl: 'http://localhost:3000',
port: 3000,
globalPrefix: '/api',
Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/main.hmr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async function bootstrap() {
},
});

await app.listen(env.server.port || 3000, '0.0.0.0');
await app.listen(env.server.port || 3000, env.server.host || '0.0.0.0');

if (module.hot) {
module.hot.accept();
Expand Down
4 changes: 2 additions & 2 deletions apps/api/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ async function bootstrap() {
}),
);

// app.useStaticAssets(join(__dirname + './../public')); // for uploaded images
// app.useStaticAssets(join(__dirname, './../public')); // for uploaded images

const options = new DocumentBuilder()
.setTitle('Sumo API Docs')
Expand Down Expand Up @@ -51,7 +51,7 @@ async function bootstrap() {
},
});

await app.listen(env.server.port || 3000, '0.0.0.0');
await app.listen(env.server.port || 3000, env.server.host || '0.0.0.0');
}

bootstrap();

0 comments on commit 74b19c4

Please sign in to comment.