- express
- mongoose
- dotenv
- cors
- eslint
- nodemon
├── index.js
├── app.js
├── controllers
│ ├──blogs.js
├── package-lock.json
├── package.json
├── utils
├── config.js
├── logger.js
└── middleware.js
├── models
├── blog.js
-
Clone the repo
-
Run
npm install
-
Run
npm run dev
to start the server with nodemon -
Run
npm start
to start the server without nodemon -
Use Postman or any Rest Client to test the endpoints
-
// GET all blogs GET http://localhost:3003/api/blogs // POST a blog POST http://localhost:3003/api/blogs { "title": "Blog Title", "author": "Blog Author", "url": "Blog URL", "likes": 0 }
- The server will run in PORT 3003 by default. You can set the PORT in your .env file.
- MongoDB database was used for this project. You can set the MONGODB_URI in your .env file.
- Run
npm run lint