0.0.250 • Published 5 years ago

express-rest-schema v0.0.250

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

A better output for your express rest-apis 🎉

Getting Started

1 Install the package

npm i express-rest-schema

2 Import it into your file

const Reponse = require('express-rest-schema') 

3 return response of your routes like this

router.get('/user/1', (req, res) => {
    return Reponse(res,  // send the response object
        { // optional parameters
            status: 200,
            response: {
                id: 1,
                name: 'John Doe'
            },
            message: 'All is well!!!',
            error: throw new Error('optional error object')
        }
    )
})

4 See the beautiful result! 😉

0.0.250

5 years ago

0.0.21

5 years ago

0.0.2

5 years ago

0.0.25

5 years ago

0.0.1

5 years ago