Skip to content

A very basic Express.js API to get shop items with filtering & searching

Notifications You must be signed in to change notification settings

2hats-co/react-ecommerce-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usage

Get all data

/

Returns all items and categories as a JSON object:

{
  "items": [{}, {}],
  "categories": ["", ""]
}

Get all items

/items

Returns all items as an array: [{}, {}].

If none found, returns empty array [].

Get items by category

/items?category[]=<a>&category[]=<b>

Returns all items that match at least one of the categories received as an array.

If none found, returns empty array [].

Get items from search query

/items?search=<query>

Returns all items with titles that match a search query as an array.

If none found, returns empty array [].

Get item by ID

/item/<ID>

Returns one item that has the ID specified.

If not found, returns nothing.

Get categories

/categories

Returns all categories as an array of strings.

Running the server locally

  1. Install using $ yarn
  2. $ yarn start
  3. Make requests to http://localhost:2428

About

A very basic Express.js API to get shop items with filtering & searching

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published