chore: fixes to http mux
This commit is contained in:
@@ -47,8 +47,7 @@ var _ = apps.Register(10, func(ctx context.Context, svc *service.Harness) error
|
||||
span.RecordError(err)
|
||||
return err
|
||||
}
|
||||
svc.Add(eventstore)
|
||||
svc.Add(&es.EventStore{EventStore: eventstore})
|
||||
svc.Add(eventstore, &es.EventStore{EventStore: eventstore})
|
||||
|
||||
return nil
|
||||
})
|
||||
|
||||
@@ -2,12 +2,10 @@ package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
"github.com/sour-is/ev/app/gql"
|
||||
"github.com/sour-is/ev/internal/lg"
|
||||
"github.com/sour-is/ev/pkg/gql/resolver"
|
||||
"github.com/sour-is/ev/pkg/mux"
|
||||
"github.com/sour-is/ev/pkg/service"
|
||||
"github.com/sour-is/ev/pkg/slice"
|
||||
)
|
||||
@@ -22,9 +20,10 @@ var _ = apps.Register(90, func(ctx context.Context, svc *service.Harness) error
|
||||
span.RecordError(err)
|
||||
return err
|
||||
}
|
||||
svc.Add(gql, mux.RegisterHTTP(func(mux *http.ServeMux) {
|
||||
mux.Handle("/", http.RedirectHandler("/playground", http.StatusTemporaryRedirect))
|
||||
}))
|
||||
svc.Add(gql)
|
||||
// svc.Add(mux.RegisterHTTP(func(mux *http.ServeMux) {
|
||||
// mux.Handle("/", http.RedirectHandler("/playground", http.StatusTemporaryRedirect))
|
||||
// }))
|
||||
|
||||
return nil
|
||||
})
|
||||
|
||||
@@ -21,6 +21,11 @@ var _ = apps.Register(20, func(ctx context.Context, svc *service.Harness) error
|
||||
mux := mux.New()
|
||||
s.Handler = cors.AllowAll().Handler(mux)
|
||||
|
||||
// s.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
// log.Println(r.URL.Path)
|
||||
// mux.ServeHTTP(w, r)
|
||||
// })
|
||||
|
||||
s.Addr = env.Default("EV_HTTP", ":8080")
|
||||
if strings.HasPrefix(s.Addr, ":") {
|
||||
s.Addr = "[::]" + s.Addr
|
||||
|
||||
Reference in New Issue
Block a user