From a52e63cf65bb6240178bb845cc81c0170b220cac Mon Sep 17 00:00:00 2001 From: zu1k Date: Sat, 22 Aug 2020 15:49:35 +0800 Subject: [PATCH] fix domain race --- api/router.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/api/router.go b/api/router.go index 404a2f0..a131c1b 100644 --- a/api/router.go +++ b/api/router.go @@ -13,7 +13,6 @@ import ( ) var router *gin.Engine -var domain = "proxy.tgbot.co" func setupRouter() { router = gin.Default() @@ -34,25 +33,25 @@ func setupRouter() { router.GET("/clash", func(c *gin.Context) { c.HTML(http.StatusOK, "clash.html", gin.H{ - "domain": domain, + "domain": config.SourceConfig.Domain, }) }) router.GET("/surge", func(c *gin.Context) { c.HTML(http.StatusOK, "surge.html", gin.H{ - "domain": domain, + "domain": config.SourceConfig.Domain, }) }) router.GET("/clash/config", func(c *gin.Context) { c.HTML(http.StatusOK, "clash-config.yaml", gin.H{ - "domain": domain, + "domain": config.SourceConfig.Domain, }) }) router.GET("/surge/config", func(c *gin.Context) { c.HTML(http.StatusOK, "surge.conf", gin.H{ - "domain": domain, + "domain": config.SourceConfig.Domain, }) })