Skip to content

Commit

Permalink
fix: cancel api replace to avoid missing host
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Feb 21, 2023
1 parent e39299b commit 50579fe
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 3 deletions.
2 changes: 0 additions & 2 deletions server/static/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ import (
)

type SiteConfig struct {
ApiURL string
BasePath string
Cdn string
}

func getSiteConfig() SiteConfig {
siteConfig := SiteConfig{
ApiURL: conf.Conf.SiteURL,
BasePath: conf.URL.Path,
Cdn: strings.ReplaceAll(strings.TrimSuffix(conf.Conf.Cdn, "/"), "$version", conf.WebVersion),
}
Expand Down
1 change: 0 additions & 1 deletion server/static/static.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ func InitIndex() {
replaceMap := map[string]string{
"cdn: undefined": fmt.Sprintf("cdn: '%s'", siteConfig.Cdn),
"base_path: undefined": fmt.Sprintf("base_path: '%s'", siteConfig.BasePath),
"api: undefined": fmt.Sprintf("api: '%s'", siteConfig.ApiURL),
}
for k, v := range replaceMap {
conf.RawIndexHtml = strings.Replace(conf.RawIndexHtml, k, v, 1)
Expand Down

0 comments on commit 50579fe

Please sign in to comment.