-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
23 lines (18 loc) · 850 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/************************************
* DemoProduct *
* Copyright(c) 2018 Reuben Antz *
* MIT Licensed *
***********************************/
const config = require('./config'),
mongoose = require('mongoose'),
log = require('./util/logger').getLogger('APP');
mongoose.Promise = config.mongoose.Promise;
mongoose.connect(config.mongoose.connection, {useMongoClient: true})
.then(() => {
log.info('Connected to mongodb!');
require('./server.js');
})
.catch(err => {
log.error(err.message, err.name);
});
if(!config.jwt.secret || config.jwt.secret === 'SOMETHINGELSE'){utils.warn("No jwt secret key specified")};