Cleanups
This commit is contained in:
11
cmd/main.go
11
cmd/main.go
@@ -9,14 +9,19 @@ import (
|
||||
|
||||
func main() {
|
||||
router := gin.Default()
|
||||
|
||||
metricRouter := gin.Default()
|
||||
metrics := ginmetrics.GetMonitor()
|
||||
metrics.SetMetricPath("/metrics")
|
||||
metrics.Use(router)
|
||||
metrics.Expose(metricRouter)
|
||||
|
||||
router.GET("/api/v1/gin", func(c *gin.Context) {
|
||||
c.String(http.StatusOK, "Hello " + os.Getenv("USERNAME") + " from " + os.Getenv("MY_POD_NAME") + " with log level " + os.Getenv("LOG_LEVEL"))
|
||||
router.GET("/", func(c *gin.Context) {
|
||||
c.String(http.StatusOK, "Hello " + os.Getenv("USERNAME") + " from " + os.Getenv("MY_POD_NAME"))
|
||||
})
|
||||
|
||||
go func() {
|
||||
_ = metricRouter.Run(":8080")
|
||||
}()
|
||||
|
||||
router.Run(":8000")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user