Skip to content

A RESTful API connected to a MongoDB DataBase and running on a local Node.js server. The DB contains javascript objects, each object have "title" and "content" fields that stores the data of the articles. Send HTTP requests via POSTMAN and perform CRUD operations on the database.

Notifications You must be signed in to change notification settings

YanivWein24/Wiki-REST-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wiki-REST-API


Requirements:

  • Node.js & Express
  • MongoDB
  • Postman (to send HTTP requests)
  • Download the code or clone it to your local repository.
  • npm install all dependencies from package.json.
  • Run app.js on a local node server (default PORT number: 3000).

Changing PORT number:

On the bottom of app.js there's a Listen function that use the default port - 3000.
To change the port number, you need to change the arg inside the function from "3000" to your preferred port.

app.listen(3000, function () {

Sending HTTP requests via Postman:

  • If you wish to target ALL the objects, use this URL:

    • localhost:PortNumber/articles/
    • Example:   localhost:3000/articles/
  • If you wish to target a specific object, use this URL:

    • localhost:PortNumber/articles/ArticleTitle
    • Example:   localhost:3000/articles/API

If you wish to add Key:Value pairs for your request (for example, for a put request), tap on
the "Body" section inside your request in postman, and select "x-www-form-urlencoded" encoding.
Here you can add as many Key:Value pairs as you like.

Screenshots:

Get all articles:
GET-ALL

Post new article:
POST

Put (update) an article:
PUT

Delete an article:
DELETE

About

A RESTful API connected to a MongoDB DataBase and running on a local Node.js server. The DB contains javascript objects, each object have "title" and "content" fields that stores the data of the articles. Send HTTP requests via POSTMAN and perform CRUD operations on the database.

Topics

Resources

Stars

Watchers

Forks