routes icon indicating copy to clipboard operation
routes copied to clipboard

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

Open ghost opened this issue 11 years ago • 2 comments

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).

ghost avatar Aug 19 '14 21:08 ghost

add tests for your change in routes_test.go

haisum avatar Dec 30 '14 16:12 haisum

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

ghost avatar Dec 31 '14 18:12 ghost