3.0.0 • Published 7 years ago

@mariusc23/micro-methods v3.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 years ago

micro-methods

Method validation middleware for micro.

Installation

npm install --save @mariusc23/micro-methods

Usage

const { applyMiddleware } = require('@mariusc23/micro-middleware')
const { allowMethods } = require('@mariusc23/micro-methods')

const middleware = [
  allowMethods(['GET'])
]

module.exports = applyMiddleware(middleware, async (req, res) => {
  return 'Hello world'
})

License

Copyright (c) 2017 Marius Craciunoiu. Licensed under the MIT license.