base: Don't load database/mssql unless we need to

master
Jonatan Nilsson 2023-11-05 06:23:43 +00:00
parent 6f39e97977
commit d9ca9bcc52
2 changed files with 4 additions and 3 deletions

View File

@ -1,7 +1,6 @@
import { Flaska, QueryHandler, JsonHandler, FormidableHandler } from 'flaska'
import formidable from 'formidable'
import { initPool } from './db.mjs'
import config from './config.mjs'
import PageRoutes from './page/routes.mjs'
import ArticleRoutes from './article/routes.mjs'
@ -109,7 +108,9 @@ export default class Server {
}
runCreateDatabase() {
return initPool(this.core, config.get('mssql'))
return import('./db.mjs').then(db => {
return db.initPool(this.core, config.get('mssql'))
})
}
runStartListen() {

View File

@ -1,6 +1,6 @@
{
"name": "nfp_is",
"version": "1.0.1",
"version": "1.0.2",
"port": 4220,
"description": "nfp.is website",
"main": "index.mjs",