Add config file support and update default ports

This commit is contained in:
Federico Jaramillo Martinez
2026-05-08 16:54:39 +02:00
parent 87b4fccb41
commit 5b339e192d
5 changed files with 152 additions and 17 deletions
+3 -3
View File
@@ -1,6 +1,6 @@
import { effectivePiWebConfig } from "../config.js";
import { buildApp } from "./app.js";
const app = await buildApp();
const port = Number(process.env["PI_WEB_PORT"] ?? process.env["PORT"] ?? 3000);
const host = process.env["PI_WEB_HOST"] ?? "127.0.0.1";
await app.listen({ port, host });
const { config } = effectivePiWebConfig();
await app.listen({ port: config.port ?? 8504, host: config.host ?? "127.0.0.1" });