Sign inSign up

developerrsquared/json-server

By developerrsquared

•Updated almost 6 years ago

JSON Server provides REST API mocking based on plain JSON.

Image
0

394

developerrsquared/json-server repository overview

⁠JSON Server

JSON Server⁠ provides REST API mocking based on plain JSON.

⁠Run with Docker

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 container
  • developerrsquared/json-server the name of this docker image
⁠More examples

Most examples documented in JSON Server project⁠ site will work. For example:

docker run developerrsquared/json-server --help

⁠Run with Docker Compose

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

Tag summary

Content type

Image

Digest

Size

348.2 MB

Last updated

almost 6 years ago

docker pull developerrsquared/json-server