本文整理汇总了TypeScript中sequelize-typescript.Sequelize.authenticate方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Sequelize.authenticate方法的具体用法?TypeScript Sequelize.authenticate怎么用?TypeScript Sequelize.authenticate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sequelize-typescript.Sequelize
的用法示例。
在下文中一共展示了Sequelize.authenticate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: Sequelize
}
: console.log
const sequelize = new Sequelize({
database: config.db.database,
dialect: config.db.dialect,
username: config.db.username,
password: config.db.password,
host: config.db.host,
port: config.db.port,
pool: config.db.pool,
logging: config.db.logging ? logging : false,
})
sequelize.addModels([__dirname + '/bo'])
sequelize.authenticate()
.then((/* err */) => {
console.log('----------------------------------------')
console.log('DATABASE â')
console.log(' HOST %s', config.db.host)
console.log(' PORT %s', config.db.port)
console.log(' DATABASE %s', config.db.database)
console.log('----------------------------------------')
MigrateService.checkAndFix()
})
.catch(err => {
console.log('Unable to connect to the database:', err)
})
export default sequelize