Skip to content

Commit

Permalink
Added empty response for requests to /
Browse files Browse the repository at this point in the history
  • Loading branch information
RuhNet committed Apr 21, 2022
1 parent 0af84c4 commit 14a6ba7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ func main() {
/////////////////////////////////////////////
// ROUTES:

e.GET("/", nothingResponse)
e.HEAD("/", uptimeCheck)
e.HEAD("/up", uptimeCheck)
e.GET("/up", uptimeCheck)
Expand Down Expand Up @@ -793,6 +794,10 @@ func uptime() UpOut {
/////////////////////////////////////////////
///// API ROUTE FUNCTIONS
/////////////////////////////////////////////
func nothingResponse(c echo.Context) error {
return c.NoContent(http.StatusNotFound)
}

func uptimeCheck(c echo.Context) error {
if c.Request().Method == http.MethodHead {
return c.NoContent(http.StatusOK)
Expand Down

0 comments on commit 14a6ba7

Please sign in to comment.