Skip to content

agniswarm/mock-json-server

Repository files navigation

Mock JSON Server

How to use it

./server-<operating_system> --file <path to json fixture> --port <port number>

OPTIONS

--port :default 3000
--file : it is required
--devmode: flag to enable when you want to make changes and see the changes realtime

Example JSON File

{
    "routes": [
      {
        "path": "/users",
        "method": "GET",
        "data": "json://example/data/users.json" //relative path to the executable
      },
      {
        "path": "/settings",
        "method": "POST",
        "data": {"theme": "dark"}
      },
      {
        "path": "/users",
        "method": "GET",
        "data": [
            {"id": 1, "name": "John Doe"},
            {"id": 2, "name": "Jane Smith"}
            ]   
        }
    ]
}

Download the latest release from the Releases

About

Simple cross platform mock server from JSON, written in go.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •