We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi there, thanks for putting this library together. I was wondering if it had support for https://github.com/julienschmidt/httprouter?
I tried getting it working, but keep getting 404 not found (works with mux):
package main import ( "encoding/json" "fmt" "log" "net/http" "github.com/apex/go-apex" "github.com/fujiwara/ridge" "github.com/julienschmidt/httprouter" ) var router = httprouter.New() func init() { router.GET("/", handleRoot) router.GET("/hello", handleHello) } func main() { apex.HandleFunc(func(event json.RawMessage, ctx *apex.Context) (interface{}, error) { r, err := ridge.NewRequest(event) if err != nil { log.Println(err) return nil, err } w := ridge.NewResponseWriter() router.ServeHTTP(w, r) return w.Response(), nil }) } func handleHello(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { w.Header().Set("Content-Type", "text/plain") fmt.Fprintf(w, "Hello %s\n", r.FormValue("name")) } func handleRoot(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { w.Header().Set("Content-Type", "text/plain") fmt.Fprintln(w, "Hello World") fmt.Fprintln(w, r.URL) }
Any help would be appreciated!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi there, thanks for putting this library together. I was wondering if it had support for https://github.com/julienschmidt/httprouter?
I tried getting it working, but keep getting 404 not found (works with mux):
Any help would be appreciated!
The text was updated successfully, but these errors were encountered: