https://github.com/peimelo/toh-json-server-api
Tour of Heroes Mock API example using json-server.
https://github.com/peimelo/toh-json-server-api
api javascript json-server tour-of-heroes
Last synced: 6 months ago
JSON representation
Tour of Heroes Mock API example using json-server.
- Host: GitHub
- URL: https://github.com/peimelo/toh-json-server-api
- Owner: peimelo
- Created: 2022-01-14T03:50:45.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-01-26T00:00:56.000Z (over 4 years ago)
- Last Synced: 2025-01-24T18:09:57.965Z (over 1 year ago)
- Topics: api, javascript, json-server, tour-of-heroes
- Language: JavaScript
- Homepage: https://toh-json-server-api.vercel.app/api
- Size: 39.1 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Tour of Heroes Mock API Server
Tour of Heroes Mock API example using [json-server](https://github.com/typicode/json-server).
## Configuration
```bash
git clone https://github.com/peimelo/toh-json-server-api.git
cd toh-json-server-api
# installation of dependencies
npm install
# run the project
npm start
```
The backend is available at `http://localhost:3001/api`
## API Endpoints
The following endpoints are available:
| Endpoints | Usage | Params |
| --------------------------- | ------------------------------------- | ------------------- |
| `GET /api/heroes` | Get all of the heroes. | |
| `GET /api/heroes?name=term` | Get all heroes with name like a term. | **term** - [String] |
| `GET /api/heroes/:id` | Get the details of a single hero. | |
| `POST /api/heroes` | Add a new hero. | **name** - [String] |
| `PUT /api/heroes/:id` | Edit the details of an existing hero. | **name** - [String] |
| `DELETE /api/heroes/:id` | Remove the hero. | |