override port with runtime args

This commit is contained in:
srgooglo 2021-06-15 14:57:10 +02:00
parent b6b0dd438e
commit fe21554210

View File

@ -96,7 +96,7 @@ const DEFAULT_HEADERS = {
"Access-Control-Allow-Methods": "GET, POST, OPTIONS, PUT, PATCH, DELETE",
"Access-Control-Allow-Credentials": "true",
}
const DEFAULT_PORT = 1010
const DEFAULT_PORT = process.parsedArgs.listenPort ?? 1010
//* HELPERS
function getUptime() {
@ -170,7 +170,7 @@ function start() {
})
// TODO: set websocket server heap & events
SERVER.get("/hearbeat", (req, res, next) => {
SERVER.get("/heartbeat", (req, res, next) => {
res.json({
uptime: getUptime()
})