Skip to content

Mindflash/pairing-challenge

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setup

  • Clone this repository to your local machine.
  • Make sure you are have node v8.9.4 or higher
  • Run npm install

Endpoints

  • GET http://localhost:8080/products - Lists all products in the system.
  • GET http://localhost:8080/products?name=foo - Lists all products with the name foo.
  • GET http://localhost:8080/products/123 - Returns a single product that has id 123.
  • POST http://localhost:8080/products - Creates a new product.
    • JSON body must include a name and price, and optionally a description.
    • Name should be a string between 3 and 100 characters
    • Description should be a string between 5 and 1,000 characters
    • Price should be a number between 1 and 20,000 with no more than 2 decimal places
    • Here is an example payload:
    {
        name: 'Chinese Golden Thread Turtle',
        description: 'Chinese Golden Thread Turtles (Ocadia sinensis) are found in the lowland swamps, ponds and marshes of southern China, Taiwan and North Vietnam. They are well known for their very pretty yellow green to golden head and neck stripes, Golden Thread turtles are very active swimmers and bask frequently.',
        price: 179.00
    }

Running the server

Run node server.js to start the server. To see a list of the products navigate to http://localhost:8080/products.

Running the tests

Run node test/server.js

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%