*make the non-SSL port configurable
This commit is contained in:
parent
7f1dde272a
commit
3b1b6425ae
|
@ -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"),
|
||||||
});
|
});
|
||||||
|
|
|
@ -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" });
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue