Skip to content

Commit 260f533

Browse files
committed
fix: resolves #115
1 parent c09ca3b commit 260f533

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

server/handlers/health.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package handlers
2+
3+
import (
4+
"net/http"
5+
6+
"github.com/gin-gonic/gin"
7+
)
8+
9+
// HealthHandler is the handler for /health route.
10+
// It states if server is in healthy state or not
11+
func HealthHandler() gin.HandlerFunc {
12+
return func(c *gin.Context) {
13+
c.String(http.StatusOK, "OK")
14+
}
15+
}

server/routes/routes.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ func InitRouter() *gin.Engine {
1414
router.Use(middlewares.CORSMiddleware())
1515

1616
router.GET("/", handlers.RootHandler())
17+
router.GET("/health", handlers.HealthHandler())
1718
router.POST("/graphql", handlers.GraphqlHandler())
1819
router.GET("/playground", handlers.PlaygroundHandler())
1920
router.GET("/oauth_login/:oauth_provider", handlers.OAuthLoginHandler())

0 commit comments

Comments
 (0)