diff --git a/config.ts b/config.ts index 7bcb73f..6046e06 100644 --- a/config.ts +++ b/config.ts @@ -4,6 +4,7 @@ const dirname = new URL(".", import.meta.url).pathname; await load({ envPath: `${dirname}/.env`, export: true }); const config = { + port: Deno.env.get("PORT") || 8000, home_relay_url: Deno.env.get("HOME_RELAY_URL") || "", ldap: { url: Deno.env.get("LDAP_URL"), diff --git a/server.ts b/server.ts index c069280..0b246c3 100644 --- a/server.ts +++ b/server.ts @@ -67,7 +67,6 @@ const app = new Application(); app.use(router.routes()); app.use(router.allowedMethods()); -const PORT = 8000; -app.listen({ port: PORT }); +app.listen({ port: config.port }); -console.log(`App listening on http://localhost:${PORT}`); +console.log(`App listening on http://localhost:${config.port}`);