title: Is there a way use mux routing to select a handler without using http listenAndServe for golang?
body: <p>There are a lot of mux routers for golang.  All of the ones I've found assume that I'm building my own HTTP server in go.  However, I would like to use aws apigateway as the external layer and have it forward the method, path, query parameters to a lambda function that I have deployed with apex (go shim for aws lambda functions).  All the API gateway endpoints will forward to one lambda function so that there are fewer things to hook up, like permissions and so forth.</p>
  <p>So I would like to use nice mux libraries for their ability to parse regex or path variables, but use them inside the Lambda and be able to invoke the correct handler based on the url path.</p>
  <p>Most of the mux routers have a usage like this:</p>
  <pre><code>router := NewRouter()
  router.Add(&quot;GET&quot;, &quot;/my_path/:id&quot;, MyHandler)
  </code></pre>
  <p>Where <code>MyHandler</code> is a type of http.HandlerFunc</p>
  <p>Then the server is started with something like <code>http.ListenAndServe(port, router)</code></p>
  <p>But in AWS Lambda there is no server to start, I would just like to use the mux to find the handler that I should be calling.</p>