You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The current Router class lacks built-in support for defining routes that can handle any HTTP method any and for creating standard RESTful resource routes resource This makes it cumbersome to manage routes efficiently, requiring repetitive code and manual setup for each HTTP method and resource route.
Describe the solution you'd like
I would like the Router class to include the following methods:
Router.any: A method to define routes that respond to any HTTP method, allowing for flexible and DRY (Don't Repeat Yourself) route definitions.
Router.resource: A method to create standard RESTful resource routes (index, create, store, show, edit, update, destroy) with built-in support for parameter validation.
Describe alternatives you've considered Manually Defining Routes: Manually defining each route for resource controllers and any method handlers, which leads to repetitive code and a higher risk of errors.
Additional context
// Example of using any method to handle any HTTP methodRouter.any('req/any', (Request request) {
returnResponse.json(request.all());
});
// Example of defining resource routes with validationRouter.resource('posts', PostController())
.prefix('admin')
.middleware([AuthMiddleware()]);
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
The current Router class lacks built-in support for defining routes that can handle any HTTP method
any
and for creating standard RESTfulresource
routesresource
This makes it cumbersome to manage routes efficiently, requiring repetitive code and manual setup for each HTTP method and resource route.Describe the solution you'd like
I would like the Router class to include the following methods:
Router.any
: A method to define routes that respond to any HTTP method, allowing for flexible and DRY (Don't Repeat Yourself) route definitions.Router.resource
: A method to create standard RESTful resource routes (index
,create
,store
,show
,edit
,update
,destroy
) with built-in support for parameter validation.Describe alternatives you've considered
Manually Defining Routes: Manually defining each route for resource controllers and any method handlers, which leads to repetitive code and a higher risk of errors.
Additional context
The text was updated successfully, but these errors were encountered: