From da07ee2f4070d8f9c390dc689f61d20eae5252ee Mon Sep 17 00:00:00 2001 From: Daniel McCrystal Date: Sat, 29 Nov 2025 18:01:15 -0500 Subject: [PATCH] serve --- src/index.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 6499746..5562bb8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,10 +1,10 @@ -import { Elysia } from "elysia"; +import { Elysia, env } from "elysia"; import hash from "object-hash"; import { indexedConfig } from "./config"; import { deploy } from "./deploy"; import { PushEvent } from "./giteaTypes"; -const port = process.env.PORT ?? 6001; +const port = env.PORT ?? 6001; new Elysia() .onError(({ error }) => console.error(error)) @@ -37,6 +37,9 @@ new Elysia() void deploy({ host: service.host, commitHash }); return "deploying"; }) - .listen(port); + .listen({ + port, + hostname: env.NODE_ENV == "production" ? "0.0.0.0" : "localhost", + }); console.log(`started deployer2 on :${port}`);