feat: user routes
This commit is contained in:
23
internal/user/routes.go
Normal file
23
internal/user/routes.go
Normal file
@ -0,0 +1,23 @@
|
||||
package user
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"github.com/go-chi/chi/v5"
|
||||
)
|
||||
|
||||
type UserHandler struct {}
|
||||
|
||||
func NewUserHandler() *UserHandler {
|
||||
return &UserHandler{}
|
||||
}
|
||||
|
||||
func (h *UserHandler) RegisterRoutes(router chi.Router) {
|
||||
router.Get("/login", h.handleLogin)
|
||||
}
|
||||
|
||||
func (h *UserHandler) handleLogin(w http.ResponseWriter, r *http.Request) {
|
||||
_, _ = fmt.Fprintf(w, "/GET Hello, user from %s", r.RemoteAddr)
|
||||
}
|
||||
|
Reference in New Issue
Block a user