https://github.com/marmelab/data-generator-retail-api
A REST server exposing e-commerce resources (products, customers, orders, etc) for testing purposes
https://github.com/marmelab/data-generator-retail-api
api nodejs rest rest-api test
Last synced: 10 months ago
JSON representation
A REST server exposing e-commerce resources (products, customers, orders, etc) for testing purposes
- Host: GitHub
- URL: https://github.com/marmelab/data-generator-retail-api
- Owner: marmelab
- License: mit
- Created: 2024-03-19T20:47:15.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-21T18:05:48.000Z (almost 2 years ago)
- Last Synced: 2025-02-17T02:53:24.582Z (11 months ago)
- Topics: api, nodejs, rest, rest-api, test
- Language: JavaScript
- Homepage:
- Size: 14.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Local E-Commerce API With Fake Data
A REST API that exposes the data generated by [data-generator-retail](https://www.npmjs.com/package/data-generator-retail) using [JSON Server](https://www.npmjs.com/package/json-server).
## Installation
Clone this repository, then run:
```bash
npm install
```
## Usage
```bash
npm start
```
The data will be available at `http://localhost:3000`.
Available endpoints:
- `/products` (GET, POST)
- `/products/:id` (GET, PUT, DELETE)
- `/categories` (GET, POST)
- `/categories/:id` (GET, PUT, DELETE)
- `/orders` (GET, POST)
- `/orders/:id` (GET, PUT, DELETE)
- `/customers` (GET, POST)
- `/customers/:id` (GET, PUT, DELETE)
- `/invoices` (GET, POST)
- `/invoices/:id` (GET, PUT, DELETE)
- `/reviews` (GET, POST)
- `/reviews/:id` (GET, PUT, DELETE)
See the [JSON server documentation](https://github.com/typicode/json-server/blob/v0/README.md#routes) for more information on route parameters, e.g.:
- `/products?_page=1&_limit=10&_sort=price&_order=asc`
## HTTPS & Sharing
The app exposes the API on localhost in HTTP. You can expose it in HTTPS via a local tunnel, e.g. using [serveo](https://serveo.net/):
```bash
ssh -R 80:localhost:3000 serveo.net
```
## LICENSE
MIT, courtesy of [Marmelab](https://marmelab.com/)