From 3b1b6425aeacb3e61603f84ebe22191397e6b2a8 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 18 Apr 2023 20:28:51 -0400 Subject: [PATCH] *make the non-SSL port configurable --- src/config.ts | 1 + src/modules/app.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) 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" }); }