Simple muxer for a Go app, without regexp.
x1ddos/muxer
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Simple muxer for a Go app. package myapp import ( "net/http" muxer "code.google.com/p/go-muxer" ) func handler1(w http.ResponseWriter, r *http.Request, v url.Values) { // v will be populated with params from URL path, if any. // v.Get("id") // v.Get("action") } func init() { m := muxer.NewMux("/api", nil) m.Add("GET", "users/{id}", handler1).As("profile") m.Add("GET", "products", handler2) m.Add("PUT", "products/{id}/do", handler3) m.Add("POST", "{domain}/{action}/{id}", handler4).As("whatever") } See muxer_test.go for more.
About
Simple muxer for a Go app, without regexp.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published