Skip to content

Commit de0adf1

Browse files
committed
chore(worker): add port binding for health checks
1 parent 1f1c64c commit de0adf1

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

apps/api/src/worker.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
1+
import http from "node:http";
2+
import { env } from "@/config/env";
13
import { startTrackingWorker } from "@/workers/tracking-worker";
24

35
function main() {
6+
const PORT = Number(env.PORT) || 10_000;
7+
http
8+
.createServer((_req, res) => {
9+
res.writeHead(200);
10+
res.end("Worker is running");
11+
})
12+
.listen(PORT, "0.0.0.0");
13+
14+
console.log(`[Worker] Health check server on port ${PORT}`);
15+
416
startTrackingWorker();
517
}
618

0 commit comments

Comments
 (0)