Skip to content

Commit

Permalink
switched over to a MVC system and got it working! LETS GO
Browse files Browse the repository at this point in the history
  • Loading branch information
flbarfield committed Sep 17, 2023
1 parent b914fc7 commit baa230c
Show file tree
Hide file tree
Showing 9 changed files with 382 additions and 19 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.env
17 changes: 17 additions & 0 deletions config/database.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const mongoose = require('mongoose')

const connectDB = async () => {
try {
const conn = await mongoose.connect(process.env.DB_STRING, {
useNewUrlParser: true,
useUnifiedTopology: true,
})

console.log(`MongoDB Connected: ${conn.connection.host}`)
} catch (err) {
console.error(err)
process.exit(1)
}
}

module.exports = connectDB
5 changes: 5 additions & 0 deletions controllers/home.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
getIndex: (req, res) => {
res.render('index.ejs')
}
}
165 changes: 165 additions & 0 deletions node_modules/.package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit baa230c

Please sign in to comment.