Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created db.js file to as source of mongoose connection
- Loading branch information
1 parent
3ee542c
commit b684e94
Showing
7 changed files
with
123 additions
and
116 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
const mongoose = require("mongoose"); | ||
|
||
module.exports = (req, res, next) => { | ||
const user = res.locals.user; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const Mongoose = require("mongoose").Mongoose; | ||
|
||
const dbConnection = new Mongoose(); | ||
|
||
dbConnection.Promise = require("bluebird"); | ||
dbConnection.connect(process.env.STEIN_MONGO_URL, { useNewUrlParser: true }); | ||
|
||
|
||
module.exports = dbConnection; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters