It is a small RESTful project to realize a CRUD bookshelf with Node.js.
The user enters a favorite book name, clicks on the button, and the book name gets stored in a database. Then it redirects to a page (or uses the same page) to show the list of all favorite books stored in the database.
- Framework: Node.js, express, ejs
- DataBase: MongoDB
- Frontend: BootStrap
"dependencies": {
"body-parser": "^1.20.0",
"ejs": "^3.1.8",
"express": "^4.18.1",
"lodash": "^4.17.21",
"mongoose": "^6.6.1",
"nodemon": "^2.0.20"
}
npm i body-parser
npm i express
npm i mongoose
npm i lodash
npm i ejs
- Download MongoDB locally and install Mongosh
- Test your Mdatabase
- Run
mongosh
without any command-line options to connect to a MongoDB instance running on your localhost with default port 27017: - This is equivalent to the following command:
$ mongosh "mongodb://localhost:27017"
More detail to initiate MongoDB
- Initiate Database
- This project use default local port
$ mongosh
- Run main code
node main.js