1.2.3 • Published 4 years ago
json-spot v1.2.3
json-spot
Create a sample API for your projects due to your need easily.
Usage/Examples
First install the package globally:
npm i -g json-spotNext, create db.json in the root of your project containing API sample data:
{
"posts": [
{
"id": 1,
"title": "Title 1"
},
{
"id": 2,
"title": "Title 2"
},
...
]
}A sample file is witihin samples/ folder.
Then, use json-spot command for running the API:
json-spot --db <FILENAME> --port <PORT_NUMBER>The default of <FILENAME> and <PORT_NUMBER> options are db.json and 4000. So if these values satisfy you, you can leave them blank.
Now, open your browser and enter the address below:
localhost:4000Congratulation! Your API is ready!
Methods
json-spot supports GET, POST, DELETE and PUT HTTP request methods for manipulating APIs you would create and run.