Skip to content

Instantly share code, notes, and snippets.

@magna25
Created July 3, 2020 23:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save magna25/413e67e279c9c06a34c0ca12f84006de to your computer and use it in GitHub Desktop.
Save magna25/413e67e279c9c06a34c0ca12f84006de to your computer and use it in GitHub Desktop.
Validate incoming request data with jebena
import {jebenaExpress isEmail, minLength} from 'jebena'
const spec = {
username: isEmail(),
password: minLength(5)
}
app.post("/users", jebenaExpress(spec), (req, res) => {
//req.body is validated
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment