mirror of
https://github.com/usatiuk/ustk-todolist.git
synced 2025-10-29 08:07:48 +01:00
require authentication for todos,
use in-memody db for tests
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
const mongoose = require('mongoose');
|
||||
const config = require('./');
|
||||
|
||||
const { host, port, name } = config.db;
|
||||
const connectionString = `mongodb://${host}:${port}/${name}`;
|
||||
|
||||
async function connect() {
|
||||
const { host, port, name } = config.db;
|
||||
const connectionString = `mongodb://${host}:${port}/${name}`;
|
||||
|
||||
await mongoose.connect(connectionString);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,15 +11,8 @@ const dev = {
|
||||
},
|
||||
secret: process.env.DEV_SECRET || 'devsecret',
|
||||
};
|
||||
|
||||
const test = {
|
||||
app: {
|
||||
port: process.env.TEST_APP_PORT || 4001,
|
||||
},
|
||||
db: {
|
||||
host: process.env.TEST_DB_HOST || 'localhost',
|
||||
port: process.env.TEST_DB_PORT || 27017,
|
||||
name: process.env.TEST_DB_NAME || 'todolistTest',
|
||||
},
|
||||
secret: process.env.TEST_SECRET || 'testsecret',
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user