Ninja Parading Musically

    micro-middleware

    0.1.0 • Public • Published

    micro-middleware

    a simple helper to add middleware to your zeit/micro service

    Install

    Install with npm

    $ npm i micro-middleware --save-dev

    Usage

    // require micro-middleware helper
    var { applyMiddleware } = require('micro-middleware')
     
    // require some middleware for micro
    const cors = require('micro-cors')()
    const compress = require('micro-compress')
    const middleware = [
      cors, 
      compress
    ]
     
    // create your micro service
    const microService = async (req, res) => {
        return "hello world"
    }
     
    // apply middleware and export
    module.exports = applyMiddleware(microService, middleware)

    Running tests

    Install dev dependencies:

    $ npm i -d && npm test

    Contributing

    Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

    Author

    Mathias Karstädt

    License

    Copyright © 2017 Mathias Karstädt Licensed under the MIT license.


    This file was generated by readme-generator on March 03, 2017.

    Install

    npm i micro-middleware

    DownloadsWeekly Downloads

    4

    Version

    0.1.0

    License

    MIT

    Last publish

    Collaborators

    • webmatze