1.2.3 • Published 3 years ago

json-spot v1.2.3

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

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-spot

Next, 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:4000

Congratulation! Your API is ready!

Methods

json-spot supports GET, POST, DELETE and PUT HTTP request methods for manipulating APIs you would create and run.

License

MIT

1.2.3

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.0.0

3 years ago