Skip to content

Commit

Permalink
feat: landingserver 新增自定义根路径跳转地址
Browse files Browse the repository at this point in the history
设置环境变量 LANDING_HOME,如 https://dashboard.sourl.xyz,则访问 landingserver 根路径时会跳转过去
  • Loading branch information
jwma committed Nov 11, 2023
1 parent 35ea37f commit 96e8c35
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/app/handlers/landing.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@ import (
"github.com/jwma/jump-jump/internal/app/repository"
"log"
"net/http"
"os"
)

func LandingHome(c *gin.Context) {
home := os.Getenv("LANDING_HOME")

if home != "" {
c.Redirect(http.StatusTemporaryRedirect, home)
}

c.Redirect(http.StatusTemporaryRedirect, "https://github.com/jwma/jump-jump")
}

Expand Down

0 comments on commit 96e8c35

Please sign in to comment.