Remove basePath

This commit is contained in:
some 2024-10-02 14:14:02 -04:00
parent 28a751db3d
commit 4446d200f4
Signed by: some
GPG Key ID: 65D0589220B9BFC8

View File

@ -10,23 +10,21 @@ import (
type Server struct {
*http.ServeMux
basePath string
Logger log.Logger
Logger log.Logger
}
func NewServer(mux *http.ServeMux, basePath string, logger log.Logger) *Server {
func NewServer(mux *http.ServeMux, logger log.Logger) *Server {
if mux == nil {
mux = http.NewServeMux()
}
return &Server{
ServeMux: mux,
basePath: basePath,
Logger: logger,
}
}
func (s *Server) Handle(pattern string, handler http.Handler) {
s.ServeMux.Handle(s.basePath+pattern, handler)
s.ServeMux.Handle(pattern, handler)
}
func (s *Server) RegisterCallbackServer(srv server.CallbackServer) {