0.5.0 • Published 2 years ago

@lukeshay/next-router v0.5.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

@lukeshay/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 "@lukeshay/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.0

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.3.2

2 years ago