Skip to content

Commit

Permalink
add get and post handlers to core.http
Browse files Browse the repository at this point in the history
  • Loading branch information
almeidapaulopt committed Dec 11, 2024
1 parent 51ed906 commit 4b7674f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/core/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ func (a *HTTPServer) Handle(pattern string, handler http.Handler) {
a.Mux.Handle(pattern, finalHandler)
}

// Get method add a GET handler
func (a *HTTPServer) Get(pattern string, handler http.Handler) {
a.Handle("GET "+pattern, handler)
}

// Post method add a POST handler
func (a *HTTPServer) Post(pattern string, handler http.Handler) {
a.Handle("POST "+pattern, handler)
}

// StartServer starts a custom http server.
func (a *HTTPServer) StartServer(s *http.Server) error {
// set Logger the first middlewares
Expand Down

0 comments on commit 4b7674f

Please sign in to comment.