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('./');
|
const config = require('./');
|
||||||
|
|
||||||
async function connect() {
|
async function connect() {
|
||||||
const { host, port, name } = config.db;
|
await mongoose.connect(config.db.uri);
|
||||||
const connectionString = `mongodb://${host}:${port}/${name}`;
|
|
||||||
|
|
||||||
await mongoose.connect(connectionString);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function disconnect() {
|
async function disconnect() {
|
||||||
|
|||||||
@@ -5,9 +5,7 @@ const dev = {
|
|||||||
port: process.env.DEV_APP_PORT || 4000,
|
port: process.env.DEV_APP_PORT || 4000,
|
||||||
},
|
},
|
||||||
db: {
|
db: {
|
||||||
host: process.env.DEV_DB_HOST || 'localhost',
|
uri: process.env.DEV_DB_URI || 'mongodb://localhost/todolist',
|
||||||
port: process.env.DEV_DB_PORT || 27017,
|
|
||||||
name: process.env.DEV_DB_NAME || 'todolist',
|
|
||||||
},
|
},
|
||||||
secret: process.env.DEV_SECRET || 'devsecret',
|
secret: process.env.DEV_SECRET || 'devsecret',
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user