Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nxr

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nxr

Welcome to Next Api Router 👋 <img alt="License: ISC" src="https://img.shields.io/badge/L

  • 1.0.3
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Welcome to Next Api Router 👋

Version License: ISC Twitter: shahidcodes

A tiny api router for your next.js project. It turns your api routes to express route like syntax

🏠 Homepage

Install

npm install nxr

Usage

In your pages/api folder create a file called [...all].js or [...all].ts if using typescript and copy below to the file.

import router from "nxr";

router.get("/", (req, res) => {
  res.send({ ok: 1 });
});

export default router.handler;

How it works?

It takes advantage of next.js catch all routes and parse and bind function to the route.

Author

👤 Shahid Kamal

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

FAQs

Package last updated on 11 Sep 2021

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc