@tone./create-mock-middleware
v0.0.3
Published
An express middleware that reads the umi mock
Downloads
3
Readme
createMockMiddleware
Express mock middleware
use:
const express = require('express');
const path = require('path');
const getMockMiddleware = require('./index');
var app = express();
//Looking for the mock below the path
// default path 'mock/**/*.js' 'src/pages/*/mock/**/*.js'
app.use(getMockMiddleware());
// custom path support glob pattern
//app.use(getMockMiddleware(['mock/**/*.js','src/pages/*/mock/**/*.js']));
app.listen(3000);
console.log('look in http://localhost:3000/');