本文整理匯總了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