💁♀️ A simple API service powered by My JSON Server
GET /fruits - get all fruits
GET /fruits/:id
- get a fruit by id
GET /posts - get all posts
GET /authors - get all authors
GET /books - get all books
GET /authors/:id
/books - get all books from an author by id
GET /pokemon - get all Pokémon
GET /pokemon/id
- get a Pokémon by id
To create a new resource simply add a new property to db.json
. See example here.
{
"posts": [
{ "id": 1, "title": "Post 1" },
{ "id": 2, "title": "Post 2" },
{ "id": 3, "title": "Post 3" }
],
"comments": [
{ "id": 1, "body": "some comment", "postId": 1 },
{ "id": 2, "body": "some comment", "postId": 1 }
]
}
This creates two resources posts and comments and these endpoints
- GET
/posts
- gets all posts - GET
/posts/1
- gets one post withid
- GET
/comments
- gets all comments - GET
/comments/1
- gets one comment withid
- GET
/posts/1/comments
- gets all comments belonging to a post
You may want to check these out for public APIs
☝️ This API service is used for training and teaching purposes only. It is not meant to be used for production apps.