Skip to content
This repository has been archived by the owner on Apr 24, 2018. It is now read-only.

Added a new optional method that allows you to easily handle all the unregistered (404) routes. #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ghost
Copy link

@ghost ghost commented Aug 19, 2014

Added a new optional method that allows you to handle all the unregistered (404) routes.

For example:

mux := routes.New()
mux.Get("/", handleHome)
mux.Get("/profile/:username([a-zA-Z0-9]+)", handleUserProfile)
mux.NotFound(handle404)
...

Also updated the documention (readme).

…that no routes match allowing a custom 404 page to be produced
@ghost ghost changed the title Added a NotFound() method so a handler can be specified in the event tha... Added a new optional method that allows you to handle all the unregistered (404) routes. Aug 19, 2014
@ghost ghost changed the title Added a new optional method that allows you to handle all the unregistered (404) routes. Added a new optional method that allows you to easily handle all the unregistered (404) routes. Aug 19, 2014
@haisum
Copy link

haisum commented Dec 30, 2014

add tests for your change in routes_test.go

@ghost
Copy link
Author

ghost commented Dec 31, 2014

Sorry. I ended up using https://github.com/gorilla/mux instead. So i'm unlikely to update this patch going forward. Sorry.

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

Successfully merging this pull request may close these issues.

1 participant