New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@lshay/next-router

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@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.

latest
Source
npmnpm
Version
0.5.4
Version published
Maintainers
1
Created
Source

@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();

FAQs

Package last updated on 07 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts