This is a repository to practice building RestFul API endpoints which can be used by a frontend UI. The aim is to use this repository as a source of learning and experimentation both in how to structure & write endpoints but also how to build effect Unit Tests using Mocha & Chai.
- Clone repository
- npm run clean
- npm run test
- npm run dev
- Make Endpoint calls using browser or Postman
-
Get Road
HTTP Verb: GET
URL: localhost:3000/roads/{roadID}
-
Get Roads within Bounding Box
HTTP Verb: POST
URL: localhost:3000/roads/{bbox}
-
Get Roads within Bounding Box based on OPEN status
open - true > Road is open
open - false > Road is closed
HTTP Verb: POST
URL: localhost:3000/roads/{bbox}/{open}
-
Update a roads OPEN status
open - true > Road is open
open - false > Road is closed
HTTP Verb: PUT
URL: localhost:3000/roads/{roadID}?open={boolean}¬es={string}