1.0.1 • Published 6 years ago

meetyou-express-joi v1.0.1

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

joi express middleware

npm install meetyou-express-joi --save

github

https://github.com/linweiwei123/meetyou-express-joi

Example

const ExpressJoi = require('meetyou-express-joi');

const bodySchema = {
  query: {
    name: Joi.string().max(20).required(),
    company: Joi.string().max(60).required(),
    position: Joi.string().max(60).required(),
    phone: Joi.string().length(11).required(),
    email: Joi.string().email().max(50).required()
  }
};

 app.get('/brand_invitation/save', ExpressJoi(bodySchema), (req, res, next) => {
 })