lin-cms-test
Version:
The core library of Lin CMS, this package is just for test!
20 lines (19 loc) • 813 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const sequelize_1 = tslib_1.__importDefault(require("sequelize"));
const config_1 = require("./config");
// 拿到配置
const database = config_1.config.getItem("db.database", "lin-cms");
const type = config_1.config.getItem("db.type", "mysql");
const host = config_1.config.getItem("db.host", "localhost");
const port = config_1.config.getItem("db.port", 3306);
const username = config_1.config.getItem("db.username", "root");
const password = config_1.config.getItem("db.password", "123456");
const logging = config_1.config.getItem("db.logging", true);
exports.db = new sequelize_1.default(database, username, password, {
host: host,
port: port,
dialect: type,
logging: logging
});