Add config.js, dockerfile

This commit is contained in:
wancat committed 2023-07-21 11:27:01 +08:00
1 parent 4ffdb5d627
commit 2dffd2f74d
5 files changed
+48 -4

No files matched your search

+2 -1
View File
@@ -1,8 +1,9 @@
import mongoose from 'mongoose'
import config from './config.js'
export default async function connectDB() {
try {
await mongoose.connect('mongodb://localhost:27017/odyssey-test')
await mongoose.connect(config.db)
console.log('Connected to MongoDB')
} catch (err) {
console.log(err)