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.
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.
Most of the mux routers have a usage like this:
router := NewRouter()
router.Add("GET", "/my_path/:id", MyHandler)
Where MyHandler
is a type of http.HandlerFunc
Then the server is started with something like http.ListenAndServe(port, router)
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.