Sign inSign up

vimagick/json-server

By vimagick

Updated over 2 years ago

Get a full fake REST API with zero coding in less than 30 seconds (seriously)

Image
Developer tools
17

500K+

vimagick/json-server repository overview

json-server

:warning: THIS IMAGE WAS MOVED TO: https://hub.docker.com/r/easypi/json-server

Get a full fake REST API with zero coding in less than 30 seconds (seriously) with json-server.

docker-compose.yml

json-server:
  image: vimagick/json-server
  command: -H 0.0.0.0 -p 3000 -w db.json
  ports:
    - "3000:3000"
  volumes:
    - ./data:/data
  restart: always

data/db.json

{
  "posts": [
    { "id": 1, "title": "json-server", "author": "typicode" }
  ],
  "comments": [
    { "id": 1, "body": "some comment", "postId": 1 }
  ],
  "profile": { "name": "typicode" }
}

up and running

docker-compose up -d

pip install httpie

http GET :3000/posts
http POST :3000/posts id:=2 title=hello author=world
http PUT :3000/posts/2 title=Hello author=World
http PATCH :3000/posts/2 title=HELLO
http DELETE :3000/posts/2
http GET :3000/db

Tag summary

Content type

Image

Digest

sha256:2d07724c6

Size

27.1 MB

Last updated

over 2 years ago

docker pull vimagick/json-server