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

This commit is contained in:
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 { Flaska, QueryHandler, JsonHandler, FormidableHandler } from 'flaska'
import formidable from 'formidable' import formidable from 'formidable'
import { initPool } from './db.mjs'
import config from './config.mjs' import config from './config.mjs'
import PageRoutes from './page/routes.mjs' import PageRoutes from './page/routes.mjs'
import ArticleRoutes from './article/routes.mjs' import ArticleRoutes from './article/routes.mjs'
@ -109,7 +108,9 @@ export default class Server {
} }
runCreateDatabase() { runCreateDatabase() {
return initPool(this.core, config.get('mssql')) return import('./db.mjs').then(db => {
return db.initPool(this.core, config.get('mssql'))
})
} }
runStartListen() { runStartListen() {

View file

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