Now showing startup-time.
This commit is contained in:
parent
f978f01a6e
commit
c65845b528
4
index.js
4
index.js
|
@ -15,6 +15,7 @@ import { generateDB } from './libs/database/generate.js'
|
||||||
import { dbInit } from './libs/database/init.js'
|
import { dbInit } from './libs/database/init.js'
|
||||||
import { downloadEssentialData } from './libs/download/dowload.js'
|
import { downloadEssentialData } from './libs/download/dowload.js'
|
||||||
|
|
||||||
|
const start = Date.now()
|
||||||
const log = initLog("[ MAIN ]")
|
const log = initLog("[ MAIN ]")
|
||||||
|
|
||||||
// Read the .env file
|
// Read the .env file
|
||||||
|
@ -42,4 +43,7 @@ Server.use('/', routes)
|
||||||
Server.use('/api', routes)
|
Server.use('/api', routes)
|
||||||
Server.use('/assets', express.static('static'))
|
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}.`))
|
Server.listen(process.env.PORT ?? 12345, () => log(`Server started and listening on port ${process.env.PORT}.`))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user