mirror of
https://github.com/usatiuk/ustk-todolist.git
synced 2025-10-28 15:47:48 +01:00
change db config
This commit is contained in:
@@ -2,10 +2,7 @@ const mongoose = require('mongoose');
|
||||
const config = require('./');
|
||||
|
||||
async function connect() {
|
||||
const { host, port, name } = config.db;
|
||||
const connectionString = `mongodb://${host}:${port}/${name}`;
|
||||
|
||||
await mongoose.connect(connectionString);
|
||||
await mongoose.connect(config.db.uri);
|
||||
}
|
||||
|
||||
async function disconnect() {
|
||||
|
||||
@@ -5,9 +5,7 @@ const dev = {
|
||||
port: process.env.DEV_APP_PORT || 4000,
|
||||
},
|
||||
db: {
|
||||
host: process.env.DEV_DB_HOST || 'localhost',
|
||||
port: process.env.DEV_DB_PORT || 27017,
|
||||
name: process.env.DEV_DB_NAME || 'todolist',
|
||||
uri: process.env.DEV_DB_URI || 'mongodb://localhost/todolist',
|
||||
},
|
||||
secret: process.env.DEV_SECRET || 'devsecret',
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user