Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convenience methods for adding routes #28

Open
bnkamalesh opened this issue Feb 13, 2021 · 0 comments
Open

Convenience methods for adding routes #28

bnkamalesh opened this issue Feb 13, 2021 · 0 comments

Comments

@bnkamalesh
Copy link
Member

Is your feature request related to a problem? Please describe.

Adding routes currently requires the developer to prepare a single list of *Route with all the routes defined in one go. This can be split up and made easier for the developer

Describe the solution you'd like

We can add convenience method for each type of HTTP method supported by webgo (). e.g.

router.Add(*Route)
router.Get("URI",[]Handlers{}, opts...)
router.Head("URI",[]Handlers{}, opts...)
router.Post("URI",[]Handlers{}, opts...)
router.Put("URI",[]Handlers{}, opts...)
router.Patch("URI",[]Handlers{}, opts...)
router.Delete("URI",[]Handlers{}, opts...)
router.Option("URI",[]Handlers{},opts...)

Each method should keep updating routes of the router, for the respective HTTP method.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant