mirror of
https://github.com/journey-ad/Moe-Counter.git
synced 2024-11-27 17:00:51 +01:00
add default mongodb url(local server)
This commit is contained in:
parent
a5130cc5a3
commit
d94b2f64ab
@ -3,7 +3,12 @@
|
||||
const mongoose = require('mongoose')
|
||||
const schema = require('./schema')
|
||||
|
||||
mongoose.connect(process.env.DB_URL, {
|
||||
// the default mongodb url (local server)
|
||||
let mongodbURL = `mongodb://127.0.0.1:27017`
|
||||
const envMongoURL = process.env.DB_URL
|
||||
if (envMongoURL) mongodbURL = envMongoURL
|
||||
|
||||
mongoose.connect(mongodbURL, {
|
||||
useNewUrlParser: true,
|
||||
useUnifiedTopology: true,
|
||||
useFindAndModify: false
|
||||
|
Loading…
Reference in New Issue
Block a user