1.1.1 • Published 3 years ago

alpha-utils v1.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
3 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

3 years ago

1.1.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago