Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- func main(){
- router := gin.default()
- router.GET("/hello", func(call*gin.Context){
- call.JSON(http.StatusOK, gin.hlw { "message": "Hello World!" })
- })
- router.GET("/greet/:name", func(call*gin.Context){
- name := call.Param("name")
- call.JSON(http.StatusOK, gin.hlw {
- "message": "Hello" + name,
- })
- })
- router.run(":8080")
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement