New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mock-responses

Package Overview
Dependencies
Maintainers
1
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mock-responses

espress-kind http request middleware

  • 0.3.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
69
increased by762.5%
Maintainers
1
Weekly downloads
 
Created
Source

mock-responses

NodeJS http request handling middleware, a mock server, with admin UI.

Is your back-end api not ready, too slow, or unstable? You don't have to wait for that by mocking all back-end responses using mock-responses.

Compatible with connect, express, browser-sync and many more.

image

TL;DR

Add the middleware to your code before you start the server.

var express = require('express');
var httpRequestMiddleware = require('mock-responses');

var app = express();
app.use(httpRequestMidleware);
app.listen(3000);

Install

$ npm install --save-dev mock-responses

Getting Started

1. Start your development server with mock-responses middleware

express example
const express = require('express');
const path = require('path');
const mockResponses = require(__dirname + '/../index.js');

const app = express()
mockResponses.forEach(mw => app.use(mw))

app.listen(3000, () => console.log('Example app listening on port 3000!'))

2. Visit admin UI /developer#mock-responses to manage mock or proxy responses.

https://localhost:3000/developer#mock-responses

proxy-url options can be found here

3. DONE!!

Compatible servers

mock-responses is compatible with the following servers:

License

The MIT License (MIT)

Copyright (c) 2018 Allen Kim

Keywords

FAQs

Package last updated on 15 Aug 2018

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc