mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-04 05:18:25 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			31 lines
		
	
	
		
			614 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			614 B
		
	
	
	
		
			Go
		
	
	
	
	
	
// Copyright 2022 The Gitea Authors. All rights reserved.
 | 
						|
// Use of this source code is governed by a MIT-style
 | 
						|
// license that can be found in the LICENSE file.
 | 
						|
 | 
						|
package bots
 | 
						|
 | 
						|
import (
 | 
						|
	"context"
 | 
						|
	"net/http"
 | 
						|
 | 
						|
	"code.gitea.io/gitea/modules/web"
 | 
						|
	"code.gitea.io/gitea/routers/api/bots/grpc"
 | 
						|
)
 | 
						|
 | 
						|
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)
 | 
						|
	}
 | 
						|
 | 
						|
	return m
 | 
						|
}
 |