set addr in admin

This commit is contained in:
shoopea
2023-07-31 18:19:28 +02:00
parent ca3d8177bd
commit f6fdd83a23
3 changed files with 9 additions and 10 deletions

View File

@@ -56,6 +56,10 @@ func (a *AdminConfig) Run() {
ctx, stop := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
defer stop()
if !*debug {
gin.SetMode(gin.ReleaseMode)
}
r := gin.Default()
r.GET("/ping", func(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{
@@ -64,7 +68,7 @@ func (a *AdminConfig) Run() {
})
srv := &http.Server{
Addr: ":8080",
Addr: a.Addr,
Handler: r,
}