Add level to logs in app.js

Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
Fred Boniface 2023-03-30 21:10:39 +01:00
parent ea50577946
commit 45b049714f
2 changed files with 5 additions and 5 deletions

8
app.js
View File

@ -26,7 +26,7 @@ const srvListen = process.env.OWL_SRV_LISTEN || "0.0.0.0"
const srvPort = process.env.OWL_SRV_PORT || 8460
// Print version number:
log.out(`app: Starting OwlBoard - Backend Version: ${version.app} - API versions: ${version.api}`);
log.out(`app: Starting OwlBoard - Backend Version: ${version.app} - API versions: ${version.api}`, "init");
// Test for required vars:
// const varTest = require('./src/utils/varTest.utils');
@ -61,9 +61,9 @@ app.use('/api/v1/stats', statRtr)
// Start Express
app.listen(srvPort, srvListen, (error) =>{
if(!error) {
log.out(`app.listen: Listening on http://${srvListen}:${srvPort}`);
log.out("app.listen: State - alive")
log.out(`app.listen: Listening on http://${srvListen}:${srvPort}`, "init");
log.out("app.listen: State - alive", "init")
} else {
log.out("app.listen: Error occurred, server can't start", error);
log.out(`app.listen: Error occurred, server can't start ${error}`, "err");
}
});

View File

@ -1,7 +1,7 @@
module.exports = valid
const valid = [
"owlboard.co.uk",
"owlboard.info",
"fjla.uk",
"gwr.com",
"swrailway.com",