Skip to content

Commit baccc98

Browse files
committed
feat: allow overriding api/dashboard port
1 parent 6b359ea commit baccc98

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

backend/src/api/start.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ app.use((req, res, next) => {
5757
return notFound(res);
5858
});
5959

60-
const port = 3001;
60+
const port = Number(process.env.PORT) || 3001;
6161
app.listen(port, "0.0.0.0", () => console.log(`API server listening on port ${port}`)); // tslint:disable-line
6262

6363
startBackgroundTasks();

dashboard/serve.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ fastify.get("*", (req, reply) => {
2424
reply.sendFile("index.html");
2525
});
2626

27-
fastify.listen({ port: 3002, host: '0.0.0.0' }, (err, address) => {
27+
const port = Number(process.env.PORT) || 3002;
28+
fastify.listen({ port, host: '0.0.0.0' }, (err, address) => {
2829
if (err) {
2930
throw err;
3031
}

0 commit comments

Comments
 (0)