1.1.0 • Published 10 months ago

next-method-validation v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

next-method-validation

A lightweight plugin for validating request methods in Next.js API handlers.

Installation

yarn add next-method-validation

OR

npm i next-method-validation

Usage

TypeScript usage:

import { withMethodValidation } from "next-method-validation";

const handler: NextApiHandler = async (req, res) => {
  // ...
};

export default withMethodValidation(handler, "GET");
1.1.0

10 months ago

1.0.0

10 months ago