mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
Add config.js, dockerfile
This commit is contained in:
1 parent
4ffdb5d627
commit
2dffd2f74d
5 files changed
+48
-4
No files matched your search
+2
-1
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user