summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@vidhukant.xyz>2022-12-21 19:49:52 +0530
committerVidhu Kant Sharma <vidhukant@vidhukant.xyz>2022-12-21 19:49:52 +0530
commit6581728a1291850b9fa6c5f3aaf072512d50f165 (patch)
tree362807cac916dc871f3eb310da014b8befa3a019
parent8d85b0f87590b0941dfb2d8815aa2c7b7462a89f (diff)
added ping route to check server health and login status
-rw-r--r--main.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/main.go b/main.go
index 3afd480..becba70 100644
--- a/main.go
+++ b/main.go
@@ -43,5 +43,10 @@ func main() {
user.Routes(r)
auth.Routes(r)
+ // ping server and check if logged in
+ r.POST("/ping", auth.Authorize(), func (ctx *gin.Context) {
+ ctx.Status(200)
+ })
+
r.Run(":6969")
}