Skip to content

Instantly share code, notes, and snippets.

@KolbySisk
Last active August 29, 2022 14:30
Show Gist options
  • Save KolbySisk/4bf8b8e0e11346a54905734e9cb2f3a4 to your computer and use it in GitHub Desktop.
Save KolbySisk/4bf8b8e0e11346a54905734e9cb2f3a4 to your computer and use it in GitHub Desktop.
import { use } from 'next-api-route-middleware';
const handler = async (req: NextApiRequest, res: NextApiResponse<{ message: string }>) => {
return res.status(200).json({ message: 'request was good!' });
};
export default use(validateBody(formSchema), handler);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment