diff --git a/src/config.ts b/src/config.ts index e175bc6..9126fad 100644 --- a/src/config.ts +++ b/src/config.ts @@ -26,6 +26,7 @@ switch (os.platform()) { config.inject({ "core.confdir": configDir, "core.port": 8080, + "core.apport": 80, "core.loglevel": "info", "core.plugindir": path.resolve(configDir, "..", "plugins"), }); diff --git a/src/modules/app.ts b/src/modules/app.ts index 947dc6b..b6a66b8 100644 --- a/src/modules/app.ts +++ b/src/modules/app.ts @@ -3,6 +3,7 @@ import log from "../log.js"; import fastify from "fastify"; import type { FastifyInstance } from "fastify"; import { getKeyPair } from "../lib/seed.js"; +import config from "../config"; let app: FastifyInstance; @@ -16,5 +17,5 @@ export async function start() { res.send(Buffer.from(keyPair.publicKey).toString("hex")); }); - await app.listen({ port: 80, host: "0.0.0.0" }); + await app.listen({ port: config.uint("core.appport"), host: "0.0.0.0" }); }