This is a simple restful api for articles. This restful api allows you to perform the CRUD operations on a database of articles.
To run this project first you need to setup your enviroment for nodejs. After that you need to:
- Clone this project.
- Use
npm install
command to install all the packages.
- Setup and Configure mongb locally.
- Use
mongod
command to start mongodb server using terminal. - Use
node app.js
command to start the node server on localhost.
- Setup and Configure mongodb atlas for your project.
- Setup and Configure server(heroku) for your app.
- Update
.env
file accordingly. - For Deployment, follow the guidelines provided by heroku or any other server you are using.
For testing the api you can use Postman.
This application is built with the following:
This api allows all CRUD operations and it has following endpoints:
Reuest | Path | Body Parameters | Request Parameters | Explanation |
---|---|---|---|---|
GET | http://localhost:3000/articles | - | - | to get all articles |
POST | http://localhost:3000/articles | title, content | - | add article in database |
DELETE | http://localhost:3000/articles | - | - | delete all articles |
GET | http://localhost:3000/articles/:articleTitle | - | articleTitle | get article with specific title |
PUT | http://localhost:3000/articles/:articleTitle | title, content | articleTitle | update article with specified title |
DELETE | http://localhost:3000/articles/:articleTitle | - | articleTitle | delete article with specified title |
Distributed under the MIT License. See LICENSE for more information.