From c65845b52811cec6c97f3f4343c8c7e9ad1e0380 Mon Sep 17 00:00:00 2001 From: BurnyLlama Date: Thu, 4 Nov 2021 23:04:42 +0100 Subject: [PATCH] Now showing startup-time. --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index 6c77fff..e727903 100644 --- a/index.js +++ b/index.js @@ -15,6 +15,7 @@ import { generateDB } from './libs/database/generate.js' import { dbInit } from './libs/database/init.js' import { downloadEssentialData } from './libs/download/dowload.js' +const start = Date.now() const log = initLog("[ MAIN ]") // Read the .env file @@ -42,4 +43,7 @@ Server.use('/', routes) Server.use('/api', routes) Server.use('/assets', express.static('static')) +const elapsed = Date.now() - start +log(`Took ${elapsed/1000} seconds to start the server!`) + Server.listen(process.env.PORT ?? 12345, () => log(`Server started and listening on port ${process.env.PORT}.`))