Skip to content

Commit

Permalink
Merge pull request #4 from AdityaAparadh/main
Browse files Browse the repository at this point in the history
Added MERN Stack (Finally)
  • Loading branch information
PranavG1203 authored Oct 25, 2024
2 parents 958ba9e + 8c9bf61 commit f4a558e
Show file tree
Hide file tree
Showing 21 changed files with 6,324 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
13 changes: 13 additions & 0 deletions Environments/Web Development Stacks/MERN/Backend/Dockerfile
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"]
14 changes: 14 additions & 0 deletions Environments/Web Development Stacks/MERN/Backend/db/db.js
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
Loading

0 comments on commit f4a558e

Please sign in to comment.