/url-router

Sinatra-like URL router for Golang.

Primary LanguageGo

url-router

Sinatra-like URL router for Golang.

Install

$ go get github.com/azer/url-router

Usage

routes = urlrouter.New("/users/:name", "/page/:page")

match := routes.Match("/users/john")

match
// => urlrouter.Match {
//      Params: { name: "john" }
//      Pattern: "/users/:name"
//    }

match = routes.Match("nonexisting")

match
// => nil

See test/test.go for more info.