Created
July 3, 2020 23:51
-
-
Save magna25/413e67e279c9c06a34c0ca12f84006de to your computer and use it in GitHub Desktop.
Validate incoming request data with jebena
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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