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