From 1eebe45e4e8abbc682eadbbb2e60954e28907b81 Mon Sep 17 00:00:00 2001 From: oat Date: Wed, 2 Sep 2020 16:19:29 +0300 Subject: [PATCH] wow. what a dumb variable name --- src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index b86a1db..4041f5d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,7 +7,7 @@ import * as format from './lib/format'; 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 useUnifiedTopology: true, useFindAndModify: false, @@ -37,14 +37,14 @@ const logger = winston.createLogger({ }); logger.info('connecting to mongodb database'); -dbClient.then(() => { +db.then(() => { logger.info('connected to database!'); const app = express(); app.use(express.urlencoded({ extended: true })); - app.set('db', dbClient); + app.set('db', db); app.set('config', config); app.set('logger', logger);