fix: remove useless grpc routers

This commit is contained in:
Jason Song
2022-12-12 17:28:09 +08:00
parent cca23dd4af
commit d4c47acff4
12 changed files with 191 additions and 294 deletions

View File

@@ -8,22 +8,18 @@ import (
"net/http"
"code.gitea.io/gitea/modules/web"
"code.gitea.io/gitea/routers/api/actions/grpc"
"code.gitea.io/gitea/routers/api/actions/ping"
"code.gitea.io/gitea/routers/api/actions/runner"
)
func Routes(_ context.Context, prefix string) *web.Route {
m := web.NewRoute()
for _, fn := range []grpc.RouteFn{
grpc.V1Route,
grpc.V1AlphaRoute,
grpc.HealthRoute,
grpc.PingRoute,
grpc.RunnerRoute,
} {
path, handler := fn()
m.Post(path+"*", http.StripPrefix(prefix, handler).ServeHTTP)
}
path, handler := ping.NewPingServiceHandler()
m.Post(path+"*", http.StripPrefix(prefix, handler).ServeHTTP)
path, handler = runner.NewRunnerServiceHandler()
m.Post(path+"*", http.StripPrefix(prefix, handler).ServeHTTP)
return m
}