drone-ci-golang/main.go
李寻欢 2f4c15eb9f
Some checks failed
continuous-integration/drone/push Build is failing
首次提交
2020-01-07 08:56:43 +08:00

24 lines
346 B
Go

package main
import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/sirupsen/logrus"
)
func main() {
r := gin.Default()
r.GET("/health", func(c *gin.Context) {
c.JSON(http.StatusOK, gin.H {
"health": true,
})
})
if err := r.Run(":8080"); err != nil {
logrus.WithError(err).Fatal("Couldn't listen")
}
}