0.5.4 • Published 1 year ago

@lshay/next-router v0.5.4

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@lshay/next-router

Adds basic routing to Next.js API routes. Also allows for wrapping handler functions to mutate the context that is being passed in.

Example

pages/api/hello.js:

import { router } from "@lshay/next-router";

const wrapper = (req, res, handler) => handler({ req, res, wrapped: true });

const get = (ctx) => ctx.res.json({ message: "Hello, World!" });

export default middleware(wrapper).get(get).handler();
0.5.4

1 year ago

0.5.3

1 year ago

0.5.2

2 years ago

0.5.1

2 years ago

0.5.0

2 years ago