Connect to mongodb, define schemas

This commit is contained in:
wancat committed 2023-07-19 15:30:36 +08:00
1 parent d51a75e5bc
commit 50443b96e0
13 files changed
+216 -12

No files matched your search

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