mirror of
https://github.com/xiaoxinpro/nginx-proxy-manager-zh.git
synced 2025-02-09 21:18:15 -05:00
24 lines
553 B
JavaScript
24 lines
553 B
JavaScript
![]() |
'use strict';
|
||
|
|
||
|
let config = require('config');
|
||
|
|
||
|
if (!config.has('database')) {
|
||
|
throw new Error('Database config does not exist! Read the README for instructions.');
|
||
|
}
|
||
|
|
||
|
let knex = require('knex')({
|
||
|
client: config.database.engine,
|
||
|
connection: {
|
||
|
host: config.database.host,
|
||
|
user: config.database.user,
|
||
|
password: config.database.password,
|
||
|
database: config.database.name,
|
||
|
port: config.database.port
|
||
|
},
|
||
|
migrations: {
|
||
|
tableName: 'migrations'
|
||
|
}
|
||
|
});
|
||
|
|
||
|
module.exports = knex;
|