JSON Server provides REST API mocking based on plain JSON.
394
JSON Server provides REST API mocking based on plain JSON.
You can run the container like this (from the root of this repository):
docker run --publish 8000:8000 --volume $(pwd)/json-server/data:/app/data developerrsquared/json-server
This exposes JSON Server REST API on port 8000, so you can now browse to:
http://localhost:8000
--publish {outside_port}:8000 will bind the webserver to the given outside port--volume {absolute_path_to_directory}:/app/data should be passed to mount the given JSON file into the containerdeveloperrsquared/json-server the name of this docker imageMost examples documented in JSON Server project site will work. For example:
docker run developerrsquared/json-server --help
version: '3.8'
services:
backend:
image: developerrsquared/json-server:latest
ports:
- "8000:8000"
volumes:
- ./data:/app/data
healthcheck:
test: [ "CMD-SHELL", "curl http://localhost:8000/" ]
interval: 10s
timeout: 10s
retries: 5
tty: true
stdin_open: true
Content type
Image
Digest
Size
348.2 MB
Last updated
almost 6 years ago
docker pull developerrsquared/json-server