Skip to content

Commit

Permalink
fix: no firewall dialog on first startup
Browse files Browse the repository at this point in the history
  • Loading branch information
sr258 committed Nov 23, 2021
1 parent a2d0766 commit 74af5ea
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions server/src/boot/httpServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,19 @@ import Logger from '../helpers/Logger';

const log = new Logger('boot');

export default async (app: Express) => {
export default async (app: Express): Promise<http.Server> => {
const server = http.createServer(app);
return server.listen(process.env.PORT || 0, () => {
log.info(`server booted on port ${(server.address() as any).port}`);
return new Promise((res, rej) => {
server.listen(
process.env.PORT ? Number.parseInt(process.env.PORT, 10) : 0,
'localhost',
511,
() => {
log.info(
`server booted on port ${(server.address() as any).port}`
);
res(server);
}
);
});
};

0 comments on commit 74af5ea

Please sign in to comment.