Created
December 4, 2018 12:31
-
-
Save cn007b/318180624ee1bbe1c444439004cae761 to your computer and use it in GitHub Desktop.
Plain Go vs Gin - gin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"github.com/gin-gonic/gin" | |
) | |
func main() { | |
r := gin.Default() | |
r.GET("/v1/id/:id", func(c *gin.Context) { | |
c.JSON(200, gin.H{ | |
"id": c.Param("id"), | |
}) | |
}) | |
r.Run() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment