paak
Getting Started
npm i paak
Examples
Front-end (React-form)
component { return <SomeField label='First Name' name='firstName' validate= v v /> }
Back-end (Express/Router/Middleware)
In this example, we are using paak to validate body in REST API.
some-router.js
// schema for this specific routeconst schemaForSomeRoute = firstName: v v n lastName: v v n interests: v const validateBody = { return async { // will return undefined if there is no error const hasError = if hasError resstatus400 else }} router