Skip to content

Add config for the gorestful middleware#150

Open
tekkamanendless wants to merge 1 commit intoslok:masterfrom
tekkamanendless:add-config-for-gorestful-middleware
Open

Add config for the gorestful middleware#150
tekkamanendless wants to merge 1 commit intoslok:masterfrom
tekkamanendless:add-config-for-gorestful-middleware

Conversation

@tekkamanendless
Copy link
Copy Markdown

One of the benefits of using gorestful is its fancy routes, which
let you specify "path parameters" such as "/users/{id}". This
change adds a "Config" structure for the gorestful middleware that
allows you to use the gorestful route path and not the actual
request path.

For backward compatibility, this introduces the "HandlerWithConfig"
function, and the existing "Handler" function calls "HandlerWithConfig"
with the default "Config".

The example has been updated to use "HandlerWithConfig".

One of the benefits of using gorestful is its fancy routes, which
let you specify "path parameters" such as "/users/{id}".  This
change adds a "Config" structure for the gorestful middleware that
allows you to use the gorestful route path and not the actual
request path.

For backward compatibility, this introduces the "HandlerWithConfig"
function, and the existing "Handler" function calls "HandlerWithConfig"
with the default "Config".

The example has been updated to use "HandlerWithConfig".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant