New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

simple-json-server

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-json-server

Standalone Json Server For REST Api Testing

latest
Source
npmnpm
Version
1.1.3
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

simple-json-server

Inspired from 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

Keywords

json-server

FAQs

Package last updated on 02 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts