body of a request is valid, and I don't want to make a middleware that goes through every regexp and checks if valid, like this:
if (regexp doesn't match username) {
res.json(error)
}
if (regexp doesn't match password) {
res.json(error)
}
etc.. Is there some library or a simple piece of code that does that?
Yes I can't remember the name of the library I used. If no one else responds I'll let you know of what I used when I arrive home
Обсуждают сегодня