1.1.1 • Published 4 years ago

alpha-utils v1.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

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

1.1.1

4 years ago

1.1.0

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago