1.0.0 • Published 10 years ago

rest-mock v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

rest-mock

A REST api middleware for express to mock API requests with full CRUD operations.

npm i rest-mock --save

Usage:

var Mock = require('rest-mock');
var express = require('express');
var bodyParser = require('body-parser');

var app = express();
var mock = new Mock();

mock.resource('/config', { development: true });
mock.collection('/ips', [{ip: '192.1.1.1'}, {ip: '192.1.1.2'}, {ip: '192.1.1.3'}]);

app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));

app.use('/api', mock.middleware());

app.listen(3000);

You have an example and tests.

1.0.0

10 years ago

0.3.0

10 years ago

0.2.0

10 years ago

0.1.0

10 years ago