Skip to content

Boston343/Wiki-REST-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wiki REST API

REST API for a basic Wiki site. This uses Express and Mongoose.

This has no actual webpage. This is meant to be accessed through API. I used "Postman" for testing it, and created routes according to REST. This does some error checking but is not fool-proof.

Routes Available

HTTP Verbs /articles /articles/:articleTitle
GET Fetches ALL the articles Fetches THE article :articleTitle
POST Creates ONE new article -
PUT - Updates THE article :articleTitle
PATCH - Updates THE article :articleTitle
DELETE Deletes ALL the articles Deletes THE article :articleTitle

Route Details

Unless otherwise stated below, no body key/value pairs are needed.

For /articles/:articleTitle, the articleTitle must match the entire string of an existing article title, although case is ignored.

POST /articles

  • Needs the following urlencoded key/value pairs in the request body:
    • title: String
    • content: String

PUT /articles/:articleTitle

  • Replaces the entire article document with information in the body of the request.
  • Needs the following urlencoded key/value pairs in the request body:
    • title: String
    • content: String

PATCH /articles/:articleTitle

  • Replaces just the key/value pairs contained within the body of the request.
  • Needs ONE of the following urlencoded key/value pairs in the request body:
    • title: String
    • content: String

Dependencies

  • Node modules - inside project run npm install
  • MongoDB installed. You will need to install the free community server, as well as mongo shell for local DB testing
  • Other tools you may wish to have
    • Studio 3T - free GUI for working with MongoDB
    • Postman - free tool for testing APIs

Includes

  • JS includes
  • Mongoose
    • Connecting to MongoDB Atlas, as well as local (commented out)
    • CRUD operations

About

REST API for a basic Wiki site.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published