forked from oat/in-the-database-2
wow. what a dumb variable name
This commit is contained in:
parent
20240bfdf1
commit
1eebe45e4e
1 changed files with 3 additions and 3 deletions
|
@ -7,7 +7,7 @@ import * as format from './lib/format';
|
||||||
|
|
||||||
const config = JSON.parse(fs.readFileSync('./config/config.json', {encoding: 'utf8'}));
|
const config = JSON.parse(fs.readFileSync('./config/config.json', {encoding: 'utf8'}));
|
||||||
|
|
||||||
const dbClient = mongoose.connect(`${config.dbconnectionURL}/${config.dbname}`, {
|
const db = mongoose.connect(`${config.dbconnectionURL}/${config.dbname}`, {
|
||||||
useNewUrlParser: true, // idfk what any of this does i just copied an example
|
useNewUrlParser: true, // idfk what any of this does i just copied an example
|
||||||
useUnifiedTopology: true,
|
useUnifiedTopology: true,
|
||||||
useFindAndModify: false,
|
useFindAndModify: false,
|
||||||
|
@ -37,14 +37,14 @@ const logger = winston.createLogger({
|
||||||
});
|
});
|
||||||
|
|
||||||
logger.info('connecting to mongodb database');
|
logger.info('connecting to mongodb database');
|
||||||
dbClient.then(() => {
|
db.then(() => {
|
||||||
logger.info('connected to database!');
|
logger.info('connected to database!');
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
app.use(express.urlencoded({ extended: true }));
|
app.use(express.urlencoded({ extended: true }));
|
||||||
|
|
||||||
app.set('db', dbClient);
|
app.set('db', db);
|
||||||
app.set('config', config);
|
app.set('config', config);
|
||||||
app.set('logger', logger);
|
app.set('logger', logger);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue