hello/main.go

17 lines
344 B
Go

package main
import "github.com/gin-gonic/gin"
func main() {
r := gin.Default()
r.LoadHTMLGlob("template/*html")
r.GET("/ping", func(c *gin.Context) {
// c.JSON(200, gin.H{
// "message": "pong",
// })
// c.HTML(200, "index.html", gin.H{})
c.String(200, "hello world", gin.H{})
})
r.Run() // listen and serve on 0.0.0.0:8080
}