kit/web/routes.go

25 lines
887 B
Go
Raw Normal View History

2023-07-04 15:53:14 +00:00
package web
import (
"github.com/gofiber/fiber/v2"
)
func (s *Server) Routes() {
s.router.Get("/hello", func(c *fiber.Ctx) error {
return c.SendString("Hello, World!")
})
/*
2023-07-04 15:59:54 +00:00
s.router.Get("/login", adaptor.HTTPHandlerFunc(auth.LoginHandler))
r.HandleFunc("/logout", auth.LogoutHandler).Methods("GET")
r.HandleFunc("/login_check", auth.LoginCheckHandler).Methods("POST")
r.HandleFunc("/signup", auth.SignupHandler).Methods("GET")
r.HandleFunc("/signup_check", auth.SignupCheckHandler).Methods("POST")
r.HandleFunc("/validate/{hash:.+}", auth.ValidateLinkHandler).Methods("GET")
2023-07-04 15:53:14 +00:00
*/
// http.HandlerFunc -> fiber.Handler
//app.Get("/greet", adaptor.HTTPHandlerFunc(greet)
// where : func greet(w http.ResponseWriter, r *http.Request) { }
//app.Get("/greet", adaptor.HTTPHandler(handler(greet))
// where : func handler(f http.HandlerFunc) http.Handler { }
}