0.7.5 • Published 5 years ago
welshguard v0.7.5
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);
});