chore: add cors middleware

pull/2281/head
Steven 1 year ago
parent ad326147f1
commit 6d45616dbe

@ -66,6 +66,12 @@ func NewServer(ctx context.Context, profile *profile.Profile, store *store.Store
e.Use(middleware.Gzip())
e.Use(middleware.CORSWithConfig(middleware.CORSConfig{
Skipper: grpcRequestSkipper,
AllowOrigins: []string{"*"},
AllowMethods: []string{http.MethodGet, http.MethodHead, http.MethodPut, http.MethodPatch, http.MethodPost, http.MethodDelete},
}))
e.Use(middleware.TimeoutWithConfig(middleware.TimeoutConfig{
Skipper: grpcRequestSkipper,
Timeout: 30 * time.Second,

Loading…
Cancel
Save