hagopj13 / node-express-boilerplate

A boilerplate for building production-ready RESTful APIs using Node.js, Express, and Mongoose
MIT License
7k stars 2.06k forks source link

File-based Routing #140

Open matthiaaas opened 3 years ago

matthiaaas commented 3 years ago

Hey @hagopj13!

What do you think about using express-file-routing in this project? It makes the job of creating new routes way cleaner and less time consuming.

Directory Structure

Files inside your /routes directory will get matched an url path automatically.

├── app.js
├── routes/v1
    ├── index.ts // index routes
    ├── posts
        ├── index.ts
        └── :id.ts // dynamic params
    └── users.ts
└── package.json