title: How can I use HttpRouter with MuxChain?
body: <p>I'd like to use <a href="https://github.com/julienschmidt/httprouter" rel="nofollow">httprouter</a> with <a href="https://github.com/stephens2424/muxchain" rel="nofollow">muxchain</a> while keeping route parameters like <code>/:user/</code>.</p>
  
  <p>Take the following example:</p>
  
  <pre><code>func log(res http.ResponseWriter, req *http.Request) {
    fmt.Println("some logger")
  }
  
  func index(res http.ResponseWriter, req *http.Request) {
    fmt.Fprintf(res, "Hi there, I love %s!", req.URL.Path[1:])
  }
  
  func main() {
    logHandler := http.HandlerFunc(log)
    indexHandler := http.HandlerFunc(index)
    chain := muxchain.ChainHandlers(logHandler, indexHandler)
    router := httprouter.New()
    router.Handler("GET", "/:user", chain)
    http.ListenAndServe(":8080", router)
  }
  </code></pre>
  
  <p>When I visit <code>http://localhost:8080/john</code> I obviously don't have access to <code>ps httprouter.Params</code>
  That's because httprouter needs to see type <code>httprouter.Handle</code> but the function is called with type <code>http.Handler</code>.</p>
  
  <p>Is there any way to use both packages together? The HttpRouter GitHub repo says</p>
  
  <blockquote>
    <p>The only disadvantage is, that no parameter values can be retrieved when a http.Handler or http.HandlerFunc is used, since there is no efficient way to pass the values with the existing function parameters.</p>
  </blockquote>