{"repo":"Danilqa/node-file-router","free":true,"listed":false,"github":"https://github.com/Danilqa/node-file-router","clone":"git clone https://github.com/Danilqa/node-file-router.git","description":"💫 A file-based routing for Node.js. Works with Bun, pure Node.js, Express.js, and more!","language":"TypeScript","stars":206,"topics":["nodejs","router","express","routing","typescript","bun","middleware","auto","auto-routing"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"Node File Router A powerful file-based routing for Node.js. It simplifies the creation and organization of API services. You can effortlessly map your project's file structure to your API endpoints, enabling a clear and maintainable codebase. Technology Agnostic : Express Pure Node HTTP Bun Sockets ... whatever compatible with the interface 0 dependencies CommonJS and ES modules support TypeScript support 100% test coverage Middlewares support Overview Imagine you have a project with the following structure: Node File Router will automatically map it to your API endpoints: [POST]: /profile/orders → /api/profile/orders.[post].ts /catalog/men/black/denim → /api/catalog/[[...tags]].ts /collection/77/products/13 → /api/collection/[cid]/products/[pid].ts / → index.ts Some examples of how your file handlers can be written: Methods in a file Single response function Middlewares chain Classes Documentation Visit website to get started and view the full documentation. Usage: Getting started Usage guide Configuration Usage with Bun Get All Registered Routes Methods routing: Any method Object with methods Class with methods Methods in filenames Route matching: Plain match - /plain/route/ Exact slug - /[id]/ Catching all - /[id1]/[id2]/[idn]/ Optional catching all - ?/[id1]/[id2]/[idn]/ Support other protocols and frameworks: Custom adapter Middlewares: Usage and examples Examples Visit examples folder to see samples with different module systems, adapters, and use cases. Support I usual","default_branch":null,"files":null,"tree":[],"storefront":"/r/Danilqa","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Danilqa/node-file-router/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}