Skip to content

ajaymehul/mini-json-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Node.js App for hosting JSON objects locally with minimal effort

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published