Browse Source

Added empty response for requests to /

master v1.0.2
Ruel Tmeizeh 4 years ago
parent
commit
14a6ba79d0
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      main.go

+ 5
- 0
main.go View File

@ -224,6 +224,7 @@ func main() {
/////////////////////////////////////////////
// ROUTES:
e.GET("/", nothingResponse)
e.HEAD("/", uptimeCheck)
e.HEAD("/up", uptimeCheck)
e.GET("/up", uptimeCheck)
@ -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)


Loading…
Cancel
Save