1.0.3 • Published 5 years ago

mini-json-server v1.0.3

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

mini-json-server

mini-json-server is minimal node.js app that serves json object locally for testing.

Installation

Use npm to install mini-json-server.

npm install -g mini-json-server

Usage

Create a JSON file which includes the objects you want to serve.

JSON file includes a "collection" key with a list of JSON objects to serve as values and a "port" (optional) to specify port. Name the keys inside "collection" with the route you want it served on.

{ 
  "port" : 5000,
  "collection" : { 
    "/route1" : {
      "key1" : "value1",
      "key2" : "value2",
      "key3" : "value3"
    },
    "/route2" : {
      "key1" : "value1",
      "key2" : "value2",
      "key3" : "value3"
    }
  }
}

Launch the application and pass the path of the JSON file to serve.

mini-json-server serverCollection.json

Use the following command to initialize an example JSON file.

mini-json-server init example.json

Issues

For issues and suggestions, please open issues in the repo

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

ISC

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago