Latest Socket ResearchMalicious Chrome Extension Performs Hidden Affiliate Hijacking.Details
Socket
Book a DemoInstallSign in
Socket

node-http-mock

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-http-mock

A HTTP mock server for node.js

npmnpm
Version
0.4.6
Version published
Maintainers
1
Created
Source

node-http-mock

A HTTP mock server for node.js

Usage

Install it:

npm install node-http-mock -g

And run this command in your termial:

mock -t [api host] -p [local port] -c [config file]

Options

Run this command to see a list of all available options:

mock --help

Config

You can use config file instead of command line options:

module.exports = {
  port: 5000,
  verbose: true,
  proxy: {
    target: 'api host',
    changeOrigin: true,
  },
  mock: {
    '/path/to/to/api/1': {},
    '/path/to/to/api/2': {},
  },
}

License

MIT © BinRui.Guan

Keywords

rollup

FAQs

Package last updated on 02 Jun 2017

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