1 Star 1 Fork 0

彭国浩/liveShopServer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
database.js 1003 Bytes
一键复制 编辑 原始数据 按行查看 历史
彭国浩 提交于 2022-05-27 20:13 . 答辩结束
const mongoose = require('mongoose')
const config = require('./config')
const Schema = mongoose.Schema;
const ObjectId = Schema.Types.ObjectId;
mongoose.connect(`mongodb://localhost/${config.MongoDB.databaseName}`, { useNewUrlParser: true }, (err) => {
if (err) {
console.log(err + "数据库连接失败");
}
console.log("数据库连接成功");
})
const Models = {
User: require('./models/user'),
Good:require('./models/good'),
Comment:require('./models/comment'),
Category:require('./models/category'),
Shop:require('./models/shop'),
ShopCategory:require('./models/shopCategory'),
Order:require('./models/order'),
ShopInOrder:require('./models/shopInOrder'),
GoodInOrder:require('./models/goodInOrder'),
Address:require('./models/address'),
Cart:require('./models/cart'),
ChoiceShop:require('./models/choiceShop'),
ChoiceShopGood:require('./models/choiceShopGood'),
Live:require('./models/live')
}
module.exports = Models
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/peng_guo_hao/live-shop-server.git
git@gitee.com:peng_guo_hao/live-shop-server.git
peng_guo_hao
live-shop-server
liveShopServer
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385