Spaces:
Runtime error
Runtime error
Download src/utils/validation.js from yeshwanth-kr/dss-server: direct link, hf CLI and curl.
- Browser
- Download file 275 Bytes
-
https://huggingface.co/spaces/yeshwanth-kr/dss-server/resolve/main/src/utils/validation.js
- Command line
-
hf download hf://spaces/yeshwanth-kr/dss-server/src/utils/validation.js
-
curl -L -o validation.js https://huggingface.co/spaces/yeshwanth-kr/dss-server/resolve/main/src/utils/validation.js
275 Bytes
| const { validationResult } = require('express-validator'); | |
| function validate(req, res, next) { | |
| const errors = validationResult(req); | |
| if (!errors.isEmpty()) { | |
| return res.status(400).json({ errors: errors.array() }); | |
| } | |
| return next(); | |
| } | |
| module.exports = validate; | |