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}`);