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

[docs] Provide More Examples #151

Closed
3 of 5 tasks
elithrar opened this issue Mar 3, 2016 · 3 comments
Closed
3 of 5 tasks

[docs] Provide More Examples #151

elithrar opened this issue Mar 3, 2016 · 3 comments

Comments

@elithrar
Copy link
Contributor

elithrar commented Mar 3, 2016

mux is powerful thanks to regex, but regex can be a wall to some users. We need to document these better.

e.g.

  • r.HandleFunc("/foo{format:(.json)?}", Handler) allows you to handle optional extensions—a useful pattern. You could also do {format:(.json|.capnp|.raw)?} if you wanted as well.
  • PathPrefix + static files (this comes up a lot)
  • Naming routes.
  • Unit testing handlers
  • Writing per-route and whole-of-router middleware - func New() func(http.Handler) http.Handler vs func Thing(http.Handler) http.Handler vs func Thing(arg string, h http.Handler) http.Handler`
@elithrar elithrar self-assigned this Aug 1, 2016
wirehead pushed a commit to wirehead/mux that referenced this issue Sep 30, 2016
(this confused the heck out of me while trying to use Gorilla)

* Changed `request` to be just `r`, like the other handlers.
* Created complete wrapper function instead of just 2 lines.
kisielk added a commit that referenced this issue Jan 17, 2017
Clarify how route variables work. (#151)
@elithrar
Copy link
Contributor Author

Update:

@elithrar
Copy link
Contributor Author

Going to work on this over the coming weekend.

@stale
Copy link

stale bot commented Dec 9, 2018

This issue has been automatically marked as stale because it hasn't seen a recent update. It'll be automatically closed in a few days.

@stale stale bot added the stale label Dec 9, 2018
@stale stale bot closed this as completed Dec 17, 2018
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