This package has been deprecated

    Author message:

    use @nicolasparada/bodyparser-middleware

    @nicolasparada/json-middleware

    0.1.0 • Public • Published

    @nicolasparada/json-middleware

    JSON Body Parser Middleware

    Usage

    const createServer = require('http').createServer
    const createApp = require('@nicolasparada/web-framework')
    const json = require('@nicolasparada/json-middleware')
    
    const app = createApp()
    
    app.onPost('/echo', json(), req => {
      console.log('Body', req.body)
      return req.body
    })
    
    createServer(app.handleRequest).listen(80, '127.0.0.1', () => {
      console.log('Server running at http://localhost/')
    })

    Install

    npm i @nicolasparada/json-middleware

    DownloadsWeekly Downloads

    5

    Version

    0.1.0

    License

    MIT

    Last publish

    Collaborators

    • nicolasparada