mirror of
https://github.com/wassname/talk.git
synced 2026-06-29 16:16:48 +08:00
default connection string
This commit is contained in:
+2
-1
@@ -1,5 +1,6 @@
|
||||
const mongoose = require('mongoose');
|
||||
const enabled = require('debug').enabled;
|
||||
const url = process.env.TALK_MONGO_URL || 'mongodb://localhost/talk';
|
||||
|
||||
// Use native promises
|
||||
mongoose.Promise = global.Promise;
|
||||
@@ -9,7 +10,7 @@ if (enabled('talk:db')) {
|
||||
}
|
||||
|
||||
try {
|
||||
mongoose.connect(process.env.TALK_MONGO_URL, (err) => {
|
||||
mongoose.connect(url, (err) => {
|
||||
if (err) throw err;
|
||||
console.log('Connected to MongoDB!');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user