Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
simple validation middleware
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib its amazing.. when i look in your eyes i finally see the light
tests
.gitignore
.travis.yml
README.md
package.json

README.md

This is apache 2.0. Fork it. If you do a good job at it I will use your thing instead of mine.

INSERT MEME

build status

How it works if you have something in production or something:

module.exports = function routes(app) {
  app.get('/', function (req, res) {
    res.render('index');
  });

  app.post('/create-an-account', [require('./validate/account')], function (req, res) {
    res.render('account_created');
  });

};

Validation code looks something like this:

var val = require('val')();

module.exports = val.validate([{
  required: 'email'
  }, {
  required: 'password'
  }], function on_error(err, req, res, next) {
  res.render('account_created', {
    flash: err.message
  });
});

TOTAL WATEVS

Something went wrong with that request. Please try again.