0.4.2 ā¢ Published 2 months ago
next-validations v0.4.2
Welcome to next-validations š
NextJS API Validations
š Homepage
āØ Demo
Prerequisites
- node >=10
- nextjs >= 9
Install
yarn add next-validations
Usage
Validate custom API endpoint with Yup
yarn add yup next-validations
import { withValidation } from 'next-validations';
import * as yup from 'yup';
const schema = yup.object().shape({
name: yup.string().required(),
});
const validate = withValidation({
schema,
type: 'Yup',
mode: 'query',
});
const handler = (req, res) => {
res.status(200).json(req.query);
};
export default validate(handler);
Run tests
yarn test
Author
š¤ Huynh Duc Dung
- Website: https://productsway.com/
- Twitter: @jellydn
- Github: @jellydn
Show your support
Give a āļø if this project helped you!
(https://img.shields.io/badge/become-a patreon%20us-orange.svg?cacheSeconds=2592000)
This README was generated with ā¤ļø by readme-md-generator
1.0.0-1
2 months ago
1.0.0-0
2 months ago
0.4.1
7 months ago
0.4.0
7 months ago
0.4.2
6 months ago
0.3.3
11 months ago
0.3.2
1 year ago
0.3.0-0
1 year ago
0.3.0
1 year ago
0.3.1
1 year ago
0.2.1
2 years ago
0.2.0
2 years ago
0.1.12-0
2 years ago
0.1.11
2 years ago
0.1.10
3 years ago
0.1.9-0
3 years ago
0.1.8
3 years ago
0.1.8-2
3 years ago
0.1.8-1
3 years ago
0.1.8-0
3 years ago
0.1.7
3 years ago
0.1.7-0
3 years ago
0.1.6
3 years ago
0.1.5
3 years ago
0.1.4
3 years ago
0.1.2
3 years ago
0.1.2-0
3 years ago
0.1.1
3 years ago
0.1.1-1
3 years ago
0.1.1-0
3 years ago