*make the non-SSL port configurable

This commit is contained in:
Derrick Hammer 2023-04-18 20:28:51 -04:00
parent 7f1dde272a
commit 3b1b6425ae
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
2 changed files with 3 additions and 1 deletions

View File

@ -26,6 +26,7 @@ switch (os.platform()) {
config.inject({ config.inject({
"core.confdir": configDir, "core.confdir": configDir,
"core.port": 8080, "core.port": 8080,
"core.apport": 80,
"core.loglevel": "info", "core.loglevel": "info",
"core.plugindir": path.resolve(configDir, "..", "plugins"), "core.plugindir": path.resolve(configDir, "..", "plugins"),
}); });

View File

@ -3,6 +3,7 @@ import log from "../log.js";
import fastify from "fastify"; import fastify from "fastify";
import type { FastifyInstance } from "fastify"; import type { FastifyInstance } from "fastify";
import { getKeyPair } from "../lib/seed.js"; import { getKeyPair } from "../lib/seed.js";
import config from "../config";
let app: FastifyInstance; let app: FastifyInstance;
@ -16,5 +17,5 @@ export async function start() {
res.send(Buffer.from(keyPair.publicKey).toString("hex")); 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" });
} }