welshguard
v0.7.5
Published
This library is a validation modules group frontend and backend (for Express.js)
Downloads
127
Maintainers
Readme
welshguard.js
Welshguard is a validation library for fontend and backend (Express.js).
Installing
$ npm i --save welshguard
Backend (Express.js)
const app = express();
createServer(app).listen(3000);
const middleware = new Welshguard().getBodyGuard({
name: {required: true, notEmpty: true, type: RuleTypes.String},
});
app.post('/', middleware, (req, res) => {
res.send('hello ' + req.body.name);
});