后端链接数据库

This commit is contained in:
aixianling
2022-12-30 11:53:48 +08:00
parent cfaef6713b
commit cf5f60a049
8 changed files with 97 additions and 1 deletions

6
server/app.js Normal file
View File

@@ -0,0 +1,6 @@
module.exports = app => {
app.beforeStart(async () => {
const mysqlConfig = await app.configCenter.fetch("mysql")
app.database = app.mysql.createInstance(mysqlConfig)
})
}