Commit project
This commit is contained in:
parent
28471965a0
commit
3ac017a5ad
1030 changed files with 94062 additions and 0 deletions
18
models/index.js
Normal file
18
models/index.js
Normal file
|
@ -0,0 +1,18 @@
|
|||
const mongoose = require('mongoose');
|
||||
|
||||
module.exports.connect = (uri) => {
|
||||
mongoose.connect(uri, {
|
||||
useMongoClient: true,
|
||||
});
|
||||
|
||||
// plug in the promise library:
|
||||
mongoose.Promise = require('bluebird');
|
||||
|
||||
mongoose.connection.on('error', (err) => {
|
||||
console.error(`Mongoose connection error: ${err}`);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
// load models
|
||||
require('./merchant');
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue