mirror of
https://github.com/rjNemo/go-pass-gen
synced 2026-06-06 02:46:40 +00:00
23 lines
366 B
Go
23 lines
366 B
Go
package api
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/go-chi/chi/v5"
|
|
"github.com/go-chi/chi/v5/middleware"
|
|
)
|
|
|
|
type Server struct {
|
|
Router *chi.Mux
|
|
}
|
|
|
|
func NewServer() *Server {
|
|
s := &Server{Router: chi.NewRouter()}
|
|
s.Router.Use(middleware.Logger)
|
|
s.routes()
|
|
return s
|
|
}
|
|
|
|
func (s Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|
s.Router.ServeHTTP(w, r)
|
|
}
|