base: Don't load database/mssql unless we need to
This commit is contained in:
parent
6f39e97977
commit
d9ca9bcc52
2 changed files with 4 additions and 3 deletions
|
@ -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() {
|
||||||
|
|
|
@ -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",
|
||||||
|
|
Loading…
Reference in a new issue