jwilner/rte

Vanity route constructor

jwilner opened this issue · 0 comments

After #16, it'd be possible to have a function func Parse(is ...interface{}) []Route so that users can construct routes like:

h := rte.Must(rte.Parse(
      "GET", "/foo/:foo_id", func(w http.ResponseWriter, r *http.Request, fooID string) {},
     "POST", "/foo/:foo_id/bar/:bar_id", func(w http.ResponseWriter, r *http.Request, fooID, barID string) {
     },  myMiddleware
))