Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ node_modules
coverage
*.log
npm-debug.log*
.idea/
6 changes: 3 additions & 3 deletions src/api-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import * as http from 'http';
import * as path from 'path';
import * as cors from 'cors';
import controllers from './controllers';
import {AddressInfo} from "net";

export class ApiServer {

Expand Down Expand Up @@ -44,11 +45,10 @@ export class ApiServer {
if (err) {
return reject(err);
}

const address = this.server.address() as AddressInfo;
// TODO: replace with Morgan call
// tslint:disable-next-line:no-console
console.log(`Listening to http://${this.server.address().address}:${this.server.address().port}`);

console.log(`Listening to http://localhost:${address.port}`);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why localhost?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that would be better to print 'localhost' only if the address is undefined.

console.log(`Listening to http://${address.address? address.address:'localhost'}:${address.port}`);

return resolve();
});
});
Expand Down