Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dinhquang111 committed Aug 26, 2024
1 parent 10510b6 commit 288368a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@ package main

import (
"net/http"
"strconv"

"github.com/gin-gonic/gin"
)

func main() {
router := gin.Default()
version := 1
router.GET("/ping/:name", func(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{
"message": "pong " + c.Params.ByName("name"),
"version": "v" + strconv.Itoa(version),
})
})

Expand Down

0 comments on commit 288368a

Please sign in to comment.