Skip to content

An intuitive extension for Express.js, offering a structured approach to route and middleware management. Organize your APIs with clarity, improve DX, and streamline your Express application setup.

cantemizyurek/routeNest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌐 routeNest

🛠 Easily structure and manage your Express.js routes using a directory-based approach. 🚀

📦 Installation

npm install routenest

🌟 Features

📂 Automatic Express route generation based on directory structure.

⚙️ Supports middlewares and RESTful methods.

🌲 Clean and organized route management using a tree structure.

📖 Usage

  1. Import the library:
import routeNest from 'routenest'
  1. Organize your routes in a directory (e.g., /api):
/api
  /users
    get.js
    post.js
    /[id]
      get.js
      put.js
  1. Initialize with your routes directory:
const app = routeNest.initExpress('/api')

app.listen(3000)

💡 By default, routeNest looks into the /api directory, but you can customize the directory path by passing it to initExpress.

📘 API

initExpress(directoryPath: string)

🔍 Initializes the Express application with routes and middlewares defined in the provided directory.

Parameters:

  • directoryPath: (Optional) The path to the directory containing your routes. Defaults to /api.

Returns:

  • An initialized Express application.

🤝 Contributing

If you'd like to contribute, please fork the repository and make changes as you'd like. Pull requests are warmly welcome.

📝 License

This project is licensed under the MIT License.

About

An intuitive extension for Express.js, offering a structured approach to route and middleware management. Organize your APIs with clarity, improve DX, and streamline your Express application setup.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published