Skip to content

Commit

Permalink
Use default hostname in UI when in dev mode
Browse files Browse the repository at this point in the history
Updates #144

Change-Id: Ia101a4a3005adb9118051b3416f5a64a4a45987d
Signed-off-by: Will Norris <[email protected]>
  • Loading branch information
willnorris committed Oct 16, 2024
1 parent b3ab9a6 commit 701eb19
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions golink.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,13 @@ func init() {
}

var tmplFuncs = template.FuncMap{
// go is a template function that returns the hostname of the golink service.
// This is used throughout the UI to render links, but does not impact link resolution.
"go": func() string {
if devMode() {
// in dev mode, just use "go" instead of "localhost:8080"
return defaultHostname
}
return *hostname
},
}
Expand Down

0 comments on commit 701eb19

Please sign in to comment.