https://github.com/gsmithun4/simple-json-server
Globally installable simple json-server for UI REST api testing
https://github.com/gsmithun4/simple-json-server
json-server rest-api testing
Last synced: about 1 month ago
JSON representation
Globally installable simple json-server for UI REST api testing
- Host: GitHub
- URL: https://github.com/gsmithun4/simple-json-server
- Owner: gsmithun4
- Created: 2018-07-05T13:13:59.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-12T09:14:20.000Z (over 3 years ago)
- Last Synced: 2026-05-14T09:33:39.940Z (about 1 month ago)
- Topics: json-server, rest-api, testing
- Language: JavaScript
- Homepage:
- Size: 104 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# simple-json-server
Inspired from [json-server](https://www.npmjs.com/package/json-server).
`simple-json-server` gives the configured response data for different request methods of requests.
## Installation
```
npm install -g simple-json-server
```
## Usage
```
simple-json-server -p [port(default 3000)] -f [file name in current directory(default db.json)] -fp [file path with file name]
```
## Response Configuration
add `URL Tag` as name and response json as value in `db.json`, no restart required after configuration changes.
```
{
"API_1" : {
"GET": {
"GETresponse" : "value"
},
"POST": {
"POSTresponse" : "value"
},
"PUT": {
"PUTresponse" : "value"
},
"DELETE": {
"DELETEresponse" : "value"
}
//You can add more methods here
},
"API_2" : {
"some_response" : "value" // Returns entire json, If no methods specified
}
}
```
Hit the URL `localhost:{port}/API_1`