Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/umarnawaz33/wiki-restful-api

This is a simple restful api for articles.
https://github.com/umarnawaz33/wiki-restful-api

expressjs mongodb mongoose nodejs restful-api

Last synced: about 1 month ago
JSON representation

This is a simple restful api for articles.

Awesome Lists containing this project

README

        

## About The Project
This is a simple restful api for articles. This restful api allows you to perform the CRUD operations on a database of articles.

## Getting Started
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.

#### To Run Locally
* 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.

#### To Run on Server
* 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.

#### Testing

For testing the api you can use [Postman](https://www.postman.com/).

### Built With
This application is built with the following:
* [Node JS](https://nodejs.org/en/)
* [Express JS](https://expressjs.com/)
* [MongoDb](https://www.mongodb.com/)

## API Endpoints
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

## License

Distributed under the MIT License. See [LICENSE](https://github.com/UmarNawaz33/wiki-restful-api/blob/main/LICENSE) for more information.

## Acknowledgements
* [body-parser](https://www.npmjs.com/package/body-parser)
* [express](https://www.npmjs.com/package/express)
* [mongoose](https://www.npmjs.com/package/mongoose)