8000 GitHub - ayoungh/Rest-API: Rest API with NodeJS and ExpressJS
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ayoungh/Rest-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

REST API

This API will contain use of (HATEOS) Hypermedia as the Engine of Application State

Structure

  • models
    • This holds your models using mongoose
  • controllers
    • This holds your route functions
  • routes
    • This holds the routes for the api
  • tests
    • itemController test (basic so far)

Example API Routes

URL Endpoint Request Type Details
http://localhost:4000/api/items GET Get a list of items
http://localhost:4000/api/items POST Post an item to items
http://localhost:4000/api/items/:itemID GET Get single item using itemID
http://localhost:4000/api/items/:itemID PUT Update/replace whole single item using itemID
http://localhost:4000/api/items/:itemID PATCH Update/modify specific data for single item using the itemID
http://localhost:4000/api/items/:itemID DELETE Delete single item using itemID

To start the api:

gulp In terminal

You can run tests by doing:

gulp test In terminal

TODO

  • Add more tests
  • Add basic HATEOS to self document API - I may extend this
  • Add authentication of some sort to the API

About

Rest API with NodeJS and ExpressJS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0