2021-09-29 20:40:17 +00:00
|
|
|
package http
|
|
|
|
|
|
|
|
import (
|
2023-01-02 00:11:47 +00:00
|
|
|
"fmt"
|
|
|
|
"net/http"
|
2021-11-14 21:15:28 +00:00
|
|
|
|
2022-03-13 10:58:34 +00:00
|
|
|
"source.toby3d.me/toby3d/auth/internal/common"
|
2023-01-02 00:11:47 +00:00
|
|
|
"source.toby3d.me/toby3d/auth/internal/middleware"
|
2021-09-29 20:40:17 +00:00
|
|
|
)
|
|
|
|
|
2023-01-02 00:11:47 +00:00
|
|
|
type Handler struct{}
|
2021-09-29 20:40:17 +00:00
|
|
|
|
2023-01-02 00:11:47 +00:00
|
|
|
func NewHandler() *Handler {
|
|
|
|
return &Handler{}
|
2021-09-29 20:40:17 +00:00
|
|
|
}
|
|
|
|
|
2023-01-02 00:11:47 +00:00
|
|
|
func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|
|
|
http.HandlerFunc(middleware.HandlerFunc(h.handleFunc).Intercept(middleware.LogFmt())).ServeHTTP(w, r)
|
2021-09-29 20:40:17 +00:00
|
|
|
}
|
|
|
|
|
2023-01-02 00:11:47 +00:00
|
|
|
func (h *Handler) handleFunc(w http.ResponseWriter, r *http.Request) {
|
|
|
|
w.Header().Set(common.HeaderContentType, common.MIMETextPlainCharsetUTF8)
|
|
|
|
fmt.Fprint(w, `👌`)
|
|
|
|
w.WriteHeader(http.StatusOK)
|
2021-09-29 20:40:17 +00:00
|
|
|
}
|