0.1.0 • Published 8 years ago

auto-mock v0.1.0

Weekly downloads
2
License
ISC
Repository
github
Last release
8 years ago

auto data mock

features:

  • a method to mock data
  • build a map from ajx url to js file
  • support mock template
  • support schema

usage

//`opt.mockDir`: assign the palce to store the mock files
var opt = { mockDir: 'test/mock' };
var mock = require('auto-mock')(opt)
var server = http.createServer((req, res) => {
	mock(req, res);
});
server.listen(3000, () => {
	console.log('server is on...');
})
// if localhost:3000/api/user, test/mock/api/user.js will be builded
// it is quick to mock data

testing

npm start
0.1.0

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago