alpha-utils

1.1.1 • Public • Published

alpha-utils Build Status

This package includes some utilities used by alpha-scripts

Installation

  npm i --save-dev alpha-utils
  yarn add --dev alpha-utils

Usage

Just add the middleware to your webpack config as follows:

webpack.config.js

const mockMiddleware = require('alpha-utils/mockMiddleware');

module.exports = {
  devServer: {
    before(app) {
      app.use(mockMiddleware({path: './mock'}))
    }
  }
}

You can also use the middleware in Express app. For example:

var express = require('express');
var mockMiddleware = require('alpha-utils/mockMiddleware');

var app = express();
...
app.use(mockMiddleware({path: './mock'}))

Options

path (default: 'mock')

set the path where the mock files in

disable (default: false)

when set to true, all mock routes are disabled

Package Sidebar

Install

npm i alpha-utils

Weekly Downloads

0

Version

1.1.1

License

MIT

Unpacked Size

6.79 kB

Total Files

6

Last publish

Collaborators

  • yoranfu