You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've put lmdrouter to huge success on live staging and production environments for lambda functions but I'm struggling to use it for debugging on local. Here's my main.go code:
func main() {
environment := os.Getenv("STAGE")
if environment == "staging" || environment == "production" {
lambda.Start(router.Handler)
} else {
fmt.Println("Ready to listen and serve")
err := http.ListenAndServe(":8080", http.HandlerFunc(router.ServeHTTP))
if err != nil {
log.Fatalf("%+v", err)
}
}
}
Assuming I'm using the library correctly - every request a browser makes via HTTPS results in a CORS error. Funny enough postman had no problem with using the endpoints locally over HTTPS so it's something to do with CORS and OPTIONS which I'm not an expert on by any means. Any ideas?
The text was updated successfully, but these errors were encountered:
I've put
lmdrouter
to huge success on live staging and production environments for lambda functions but I'm struggling to use it for debugging on local. Here's mymain.go
code:Assuming I'm using the library correctly - every request a browser makes via HTTPS results in a CORS error. Funny enough postman had no problem with using the endpoints locally over HTTPS so it's something to do with CORS and
OPTIONS
which I'm not an expert on by any means. Any ideas?The text was updated successfully, but these errors were encountered: