JSON Server provides REST API mocking based on plain JSON. This is a docker image that eases setup.
957
JSON Server provides REST API mocking based on plain JSON. This is a docker image that eases setup.
Create db.json file in a directory, add your content
{
"posts": [
{ "id": 1, "title": "json-server-updated", "author": "typicode32" }
],
"comments": [
{ "id": 1, "body": "some comment new", "postId": 1 }
],
"profile": { "name": "typicode" }
}
Open terminal in the same directory and run the following command
docker run -p 3001:3000 -v ${pwd}:/data bhsonu/json-server
This will mount your local directory to the data dir of the container
Now open localhost:3001/posts/1
docker run -p 3002:3000 bhsonu/json-server
Content type
Image
Digest
Size
39.6 MB
Last updated
over 6 years ago
docker pull bhsonu/json-server