-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from AdityaAparadh/main
Added MERN Stack (Finally)
- Loading branch information
Showing
21 changed files
with
6,324 additions
and
0 deletions.
There are no files selected for viewing
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 @@ | ||
node_modules |
13 changes: 13 additions & 0 deletions
13
Environments/Web Development Stacks/MERN/Backend/Dockerfile
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,13 @@ | ||
FROM node:latest | ||
|
||
WORKDIR /app | ||
|
||
COPY . . | ||
|
||
RUN npm i | ||
|
||
RUN npm i -g nodemon | ||
|
||
EXPOSE 3000 | ||
|
||
CMD ["npm","run","dev"] |
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,14 @@ | ||
const mongoose = require('mongoose') | ||
DB_URI = process.env.DB_URI || "mongodb://localhost:27017" | ||
|
||
const db = ()=>{ | ||
try{ | ||
mongoose.connect(DB_URI) | ||
console.log(`Connected to MongoDB at : ${DB_URI}`) | ||
}catch( error ){ | ||
console.error("AN ERROR OCCURED IN DATABASE CONNECTION") | ||
console.error(error) | ||
} | ||
} | ||
|
||
module.exports = db |
Oops, something went wrong.