Skip to content

armgit / fider

Public Imported from GitHub
0

Open platform to collect and prioritize feedback

refactor: simplify CDN code (#958)

Guilherme Oenning1ee755e0eb9b
diff --git a/app/pkg/env/env_test.go b/app/pkg/env/env_test.go
index ecebb07b7..50982f176 100644
--- a/app/pkg/env/env_test.go
+++ b/app/pkg/env/env_test.go
@@ -53,21 +53,21 @@ func TestMultiTenantDomain(t *testing.T) {
func TestSubdomain(t *testing.T) {
RegisterT(t)
- Expect(env.Subdomain("demo.test.assets-fider.io")).Equals("")
+ Expect(env.Subdomain("demo.test.fidercdn.com")).Equals("")
- env.Config.CDN.Host = "test.assets-fider.io:3000"
+ env.Config.CDN.Host = "test.fidercdn.com:3000"
Expect(env.Subdomain("demo.test.fider.io")).Equals("demo")
- Expect(env.Subdomain("demo.test.assets-fider.io")).Equals("demo")
+ Expect(env.Subdomain("demo.test.fidercdn.com")).Equals("demo")
Expect(env.Subdomain("test.fider.io")).Equals("")
- Expect(env.Subdomain("test.assets-fider.io")).Equals("")
+ Expect(env.Subdomain("test.fidercdn.com")).Equals("")
Expect(env.Subdomain("helloworld.com")).Equals("")
env.Config.HostMode = "single"
Expect(env.Subdomain("demo.test.fider.io")).Equals("")
- Expect(env.Subdomain("demo.test.assets-fider.io")).Equals("")
+ Expect(env.Subdomain("demo.test.fidercdn.com")).Equals("")
Expect(env.Subdomain("test.fider.io")).Equals("")
- Expect(env.Subdomain("test.assets-fider.io")).Equals("")
+ Expect(env.Subdomain("test.fidercdn.com")).Equals("")
Expect(env.Subdomain("helloworld.com")).Equals("")
}
diff --git a/app/pkg/web/context.go b/app/pkg/web/context.go
index 58da9690b..fb2c61d7a 100644
--- a/app/pkg/web/context.go
+++ b/app/pkg/web/context.go
@@ -520,19 +520,6 @@ func (c *Context) SetCanonicalURL(rawurl string) {
}
}
-// GlobalAssetsURL return the full URL to a globally shared static asset
-func GlobalAssetsURL(ctx context.Context, path string, a ...interface{}) string {
- request := ctx.Value(app.RequestCtxKey).(Request)
- path = fmt.Sprintf(path, a...)
- if env.Config.CDN.Host != "" {
- if env.IsSingleHostMode() {
- return request.URL.Scheme + "://" + env.Config.CDN.Host + path
- }
- return request.URL.Scheme + "://cdn." + env.Config.CDN.Host + path
- }
- return request.BaseURL() + path
-}
-
//TenantBaseURL returns base URL for a given tenant
func TenantBaseURL(ctx context.Context, tenant *entity.Tenant) string {
request := ctx.Value(app.RequestCtxKey).(Request)
@@ -555,8 +542,8 @@ func TenantBaseURL(ctx context.Context, tenant *entity.Tenant) string {
return address
}
-// TenantAssetsURL return the full URL to a tenant-specific static asset
-func TenantAssetsURL(ctx context.Context, path string, a ...interface{}) string {
+// AssetsURL return the full URL to a tenant-specific static asset
+func AssetsURL(ctx context.Context, path string, a ...interface{}) string {
request := ctx.Value(app.RequestCtxKey).(Request)
tenant, hasTenant := ctx.Value(app.TenantCtxKey).(*entity.Tenant)
path = fmt.Sprintf(path, a...)
@@ -573,7 +560,7 @@ func TenantAssetsURL(ctx context.Context, path string, a ...interface{}) string
func LogoURL(ctx context.Context) string {
tenant, hasTenant := ctx.Value(app.TenantCtxKey).(*entity.Tenant)
if hasTenant && tenant.LogoBlobKey != "" {
- return TenantAssetsURL(ctx, "/images/%s?size=200", tenant.LogoBlobKey)
+ return AssetsURL(ctx, "/images/%s?size=200", tenant.LogoBlobKey)
}
return "https://getfider.com/images/logo-100x100.png"
}
diff --git a/app/pkg/web/context_test.go b/app/pkg/web/context_test.go
index 55f2dc15d..f6d45a0e4 100644
--- a/app/pkg/web/context_test.go
+++ b/app/pkg/web/context_test.go
@@ -120,39 +120,7 @@ func TestTenantURL_SingleHostMode(t *testing.T) {
Expect(web.TenantBaseURL(ctx, tenant)).Equals("http://demo.test.fider.io:3000")
}
-func TestGlobalAssetsURL_SingleHostMode(t *testing.T) {
- RegisterT(t)
-
- env.Config.HostMode = "single"
- ctx := newGetContext("http://feedback.theavengers.com:3000", nil)
- Expect(web.GlobalAssetsURL(ctx, "/assets/main.js")).Equals("http://feedback.theavengers.com:3000/assets/main.js")
- Expect(web.GlobalAssetsURL(ctx, "/assets/main.css")).Equals("http://feedback.theavengers.com:3000/assets/main.css")
-
- env.Config.CDN.Host = "assets-fider.io"
- Expect(web.GlobalAssetsURL(ctx, "/assets/main.js")).Equals("http://assets-fider.io/assets/main.js")
- Expect(web.GlobalAssetsURL(ctx, "/assets/main.css")).Equals("http://assets-fider.io/assets/main.css")
-}
-
-func TestGlobalAssetsURL_MultiHostMode(t *testing.T) {
- RegisterT(t)
-
- env.Config.HostMode = "multi"
- ctx := newGetContext("http://theavengers.test.fider.io:3000", nil)
- ctx.SetTenant(&entity.Tenant{
- ID: 1,
- Subdomain: "theavengers",
- CNAME: "feedback.theavengers.com",
- })
-
- Expect(web.GlobalAssetsURL(ctx, "/assets/main.js")).Equals("http://theavengers.test.fider.io:3000/assets/main.js")
- Expect(web.GlobalAssetsURL(ctx, "/assets/main.css")).Equals("http://theavengers.test.fider.io:3000/assets/main.css")
-
- env.Config.CDN.Host = "assets-fider.io"
- Expect(web.GlobalAssetsURL(ctx, "/assets/main.js")).Equals("http://cdn.assets-fider.io/assets/main.js")
- Expect(web.GlobalAssetsURL(ctx, "/assets/main.css")).Equals("http://cdn.assets-fider.io/assets/main.css")
-}
-
-func TestTenantAssetsURL_SingleHostMode(t *testing.T) {
+func TestAssetsURL_SingleHostMode(t *testing.T) {
RegisterT(t)
env.Config.HostMode = "single"
@@ -162,15 +130,15 @@ func TestTenantAssetsURL_SingleHostMode(t *testing.T) {
Subdomain: "theavengers",
})
- Expect(web.TenantAssetsURL(ctx, "/assets/main.js")).Equals("http://feedback.theavengers.com:3000/assets/main.js")
- Expect(web.TenantAssetsURL(ctx, "/assets/main.css")).Equals("http://feedback.theavengers.com:3000/assets/main.css")
+ Expect(web.AssetsURL(ctx, "/assets/main.js")).Equals("http://feedback.theavengers.com:3000/assets/main.js")
+ Expect(web.AssetsURL(ctx, "/assets/main.css")).Equals("http://feedback.theavengers.com:3000/assets/main.css")
- env.Config.CDN.Host = "assets-fider.io"
- Expect(web.TenantAssetsURL(ctx, "/assets/main.js")).Equals("http://assets-fider.io/assets/main.js")
- Expect(web.TenantAssetsURL(ctx, "/assets/main.css")).Equals("http://assets-fider.io/assets/main.css")
+ env.Config.CDN.Host = "fidercdn.com"
+ Expect(web.AssetsURL(ctx, "/assets/main.js")).Equals("http://fidercdn.com/assets/main.js")
+ Expect(web.AssetsURL(ctx, "/assets/main.css")).Equals("http://fidercdn.com/assets/main.css")
}
-func TestTenantAssetsURL_MultiHostMode(t *testing.T) {
+func TestAssetsURL_MultiHostMode(t *testing.T) {
RegisterT(t)
env.Config.HostMode = "multi"
@@ -181,12 +149,12 @@ func TestTenantAssetsURL_MultiHostMode(t *testing.T) {
CNAME: "feedback.theavengers.com",
})
- Expect(web.TenantAssetsURL(ctx, "/assets/main.js")).Equals("http://theavengers.test.fider.io:3000/assets/main.js")
- Expect(web.TenantAssetsURL(ctx, "/assets/main.css")).Equals("http://theavengers.test.fider.io:3000/assets/main.css")
+ Expect(web.AssetsURL(ctx, "/assets/main.js")).Equals("http://theavengers.test.fider.io:3000/assets/main.js")
+ Expect(web.AssetsURL(ctx, "/assets/main.css")).Equals("http://theavengers.test.fider.io:3000/assets/main.css")
- env.Config.CDN.Host = "assets-fider.io"
- Expect(web.TenantAssetsURL(ctx, "/assets/main.js")).Equals("http://theavengers.assets-fider.io/assets/main.js")
- Expect(web.TenantAssetsURL(ctx, "/assets/main.css")).Equals("http://theavengers.assets-fider.io/assets/main.css")
+ env.Config.CDN.Host = "fidercdn.com"
+ Expect(web.AssetsURL(ctx, "/assets/main.js")).Equals("http://theavengers.fidercdn.com/assets/main.js")
+ Expect(web.AssetsURL(ctx, "/assets/main.css")).Equals("http://theavengers.fidercdn.com/assets/main.css")
}
func TestCanonicalURL_SameDomain(t *testing.T) {
diff --git a/app/pkg/web/renderer.go b/app/pkg/web/renderer.go
index 57e2ad67e..6e4140149 100644
--- a/app/pkg/web/renderer.go
+++ b/app/pkg/web/renderer.go
@@ -190,9 +190,9 @@ func (r *Renderer) Render(w io.Writer, statusCode int, templateName string, prop
private["logo"] = LogoURL(ctx)
if tenant == nil || tenant.LogoBlobKey == "" {
- private["favicon"] = GlobalAssetsURL(ctx, "/favicon")
+ private["favicon"] = AssetsURL(ctx, "/favicon")
} else {
- private["favicon"] = TenantAssetsURL(ctx, "/favicon/%s", tenant.LogoBlobKey)
+ private["favicon"] = AssetsURL(ctx, "/favicon/%s", tenant.LogoBlobKey)
}
private["currentURL"] = ctx.Request.URL.String()
@@ -221,8 +221,7 @@ func (r *Renderer) Render(w io.Writer, statusCode int, templateName string, prop
"domain": env.MultiTenantDomain(),
"hasLegal": env.HasLegal(),
"baseURL": ctx.BaseURL(),
- "tenantAssetsURL": TenantAssetsURL(ctx, ""),
- "globalAssetsURL": GlobalAssetsURL(ctx, ""),
+ "assetsURL": AssetsURL(ctx, ""),
"oauth": oauthProviders.Result,
}
diff --git a/app/pkg/web/testdata/basic.html b/app/pkg/web/testdata/basic.html
index c367b0401..ef6df5b53 100755
--- a/app/pkg/web/testdata/basic.html
+++ b/app/pkg/web/testdata/basic.html
@@ -37,7 +37,7 @@
<script id="server-data" type="application/json">
- {"contextID":"CONTEXT_ID","props":{},"sessionID":"","settings":{"baseURL":"https://demo.test.fider.io:3000","domain":".test.fider.io","environment":"test","globalAssetsURL":"https://demo.test.fider.io:3000","googleAnalytics":"","hasLegal":true,"mode":"multi","oauth":[],"tenantAssetsURL":"https://demo.test.fider.io:3000"},"tenant":null,"title":"Fider"}
+ {"contextID":"CONTEXT_ID","props":{},"sessionID":"","settings":{"assetsURL":"https://demo.test.fider.io:3000","baseURL":"https://demo.test.fider.io:3000","domain":".test.fider.io","environment":"test","googleAnalytics":"","hasLegal":true,"mode":"multi","oauth":[]},"tenant":null,"title":"Fider"}
</script>
diff --git a/app/pkg/web/testdata/canonical.html b/app/pkg/web/testdata/canonical.html
index d266e9dd2..3af4fcd09 100755
--- a/app/pkg/web/testdata/canonical.html
+++ b/app/pkg/web/testdata/canonical.html
@@ -39,7 +39,7 @@
<script id="server-data" type="application/json">
- {"contextID":"CONTEXT_ID","props":{},"sessionID":"","settings":{"baseURL":"https://demo.test.fider.io:3000","domain":".test.fider.io","environment":"test","globalAssetsURL":"https://demo.test.fider.io:3000","googleAnalytics":"","hasLegal":true,"mode":"multi","oauth":[],"tenantAssetsURL":"https://demo.test.fider.io:3000"},"tenant":null,"title":"Fider"}
+ {"contextID":"CONTEXT_ID","props":{},"sessionID":"","settings":{"assetsURL":"https://demo.test.fider.io:3000","baseURL":"https://demo.test.fider.io:3000","domain":".test.fider.io","environment":"test","googleAnalytics":"","hasLegal":true,"mode":"multi","oauth":[]},"tenant":null,"title":"Fider"}
</script>
diff --git a/app/pkg/web/testdata/chunk.html b/app/pkg/web/testdata/chunk.html
index db9ef62db..c43327c25 100644
--- a/app/pkg/web/testdata/chunk.html
+++ b/app/pkg/web/testdata/chunk.html
@@ -44,7 +44,7 @@
<script id="server-data" type="application/json">
- {"contextID":"CONTEXT_ID","props":{},"sessionID":"","settings":{"baseURL":"https://demo.test.fider.io:3000","domain":".test.fider.io","environment":"test","globalAssetsURL":"https://demo.test.fider.io:3000","googleAnalytics":"","hasLegal":true,"mode":"multi","oauth":[],"tenantAssetsURL":"https://demo.test.fider.io:3000"},"tenant":null,"title":"Fider"}
+ {"contextID":"CONTEXT_ID","props":{},"sessionID":"","settings":{"assetsURL":"https://demo.test.fider.io:3000","baseURL":"https://demo.test.fider.io:3000","domain":".test.fider.io","environment":"test","googleAnalytics":"","hasLegal":true,"mode":"multi","oauth":[]},"tenant":null,"title":"Fider"}
</script>
diff --git a/app/pkg/web/testdata/home.html b/app/pkg/web/testdata/home.html
index 3174ff7ef..c5d3b0ded 100755
--- a/app/pkg/web/testdata/home.html
+++ b/app/pkg/web/testdata/home.html
@@ -37,7 +37,7 @@
<script id="server-data" type="application/json">
- {"contextID":"CONTEXT_ID","description":"My Page Description","props":{"countPerStatus":{},"posts":[],"tags":[]},"sessionID":"","settings":{"baseURL":"https://demo.test.fider.io:3000","domain":".test.fider.io","environment":"test","globalAssetsURL":"https://demo.test.fider.io:3000","googleAnalytics":"","hasLegal":true,"mode":"multi","oauth":[],"tenantAssetsURL":"https://demo.test.fider.io:3000"},"tenant":null,"title":"My Page Title · Fider"}
+ {"contextID":"CONTEXT_ID","description":"My Page Description","props":{"countPerStatus":{},"posts":[],"tags":[]},"sessionID":"","settings":{"assetsURL":"https://demo.test.fider.io:3000","baseURL":"https://demo.test.fider.io:3000","domain":".test.fider.io","environment":"test","googleAnalytics":"","hasLegal":true,"mode":"multi","oauth":[]},"tenant":null,"title":"My Page Title · Fider"}
</script>
diff --git a/app/pkg/web/testdata/oauth.html b/app/pkg/web/testdata/oauth.html
index 8c83b8c92..6ac3cb946 100755
--- a/app/pkg/web/testdata/oauth.html
+++ b/app/pkg/web/testdata/oauth.html
@@ -37,7 +37,7 @@
<script id="server-data" type="application/json">
- {"contextID":"CONTEXT_ID","props":{},"sessionID":"","settings":{"baseURL":"https://demo.test.fider.io:3000","domain":".test.fider.io","environment":"test","globalAssetsURL":"https://demo.test.fider.io:3000","googleAnalytics":"","hasLegal":true,"mode":"multi","oauth":[{"provider":"google","displayName":"Google","clientID":"1234","url":"https://demo.test.fider.io:3000/oauth/google","callbackURL":"https://demo.test.fider.io:3000/oauth/google/callback","logoBlobKey":"google.png","isCustomProvider":false,"isEnabled":true}],"tenantAssetsURL":"https://demo.test.fider.io:3000"},"tenant":null,"title":"Fider"}
+ {"contextID":"CONTEXT_ID","props":{},"sessionID":"","settings":{"assetsURL":"https://demo.test.fider.io:3000","baseURL":"https://demo.test.fider.io:3000","domain":".test.fider.io","environment":"test","googleAnalytics":"","hasLegal":true,"mode":"multi","oauth":[{"provider":"google","displayName":"Google","clientID":"1234","url":"https://demo.test.fider.io:3000/oauth/google","callbackURL":"https://demo.test.fider.io:3000/oauth/google/callback","logoBlobKey":"google.png","isCustomProvider":false,"isEnabled":true}]},"tenant":null,"title":"Fider"}
</script>
diff --git a/app/pkg/web/testdata/tenant.html b/app/pkg/web/testdata/tenant.html
index dad3f9b4b..1ff0c448b 100755
--- a/app/pkg/web/testdata/tenant.html
+++ b/app/pkg/web/testdata/tenant.html
@@ -37,7 +37,7 @@
<script id="server-data" type="application/json">
- {"contextID":"CONTEXT_ID","props":{},"sessionID":"","settings":{"baseURL":"https://demo.test.fider.io:3000","domain":".test.fider.io","environment":"test","globalAssetsURL":"https://demo.test.fider.io:3000","googleAnalytics":"","hasLegal":true,"mode":"multi","oauth":[],"tenantAssetsURL":"https://demo.test.fider.io:3000"},"tenant":{"id":0,"name":"Game of Thrones","subdomain":"","invitation":"","welcomeMessage":"","cname":"","status":0,"isPrivate":false,"logoBlobKey":""},"title":"Game of Thrones"}
+ {"contextID":"CONTEXT_ID","props":{},"sessionID":"","settings":{"assetsURL":"https://demo.test.fider.io:3000","baseURL":"https://demo.test.fider.io:3000","domain":".test.fider.io","environment":"test","googleAnalytics":"","hasLegal":true,"mode":"multi","oauth":[]},"tenant":{"id":0,"name":"Game of Thrones","subdomain":"","invitation":"","welcomeMessage":"","cname":"","status":0,"isPrivate":false,"logoBlobKey":""},"title":"Game of Thrones"}
</script>
diff --git a/app/pkg/web/testdata/user.html b/app/pkg/web/testdata/user.html
index 0d637e770..eebf31fc3 100755
--- a/app/pkg/web/testdata/user.html
+++ b/app/pkg/web/testdata/user.html
@@ -37,7 +37,7 @@
<script id="server-data" type="application/json">
- {"contextID":"CONTEXT_ID","description":"My Page Description","props":{},"sessionID":"","settings":{"baseURL":"https://demo.test.fider.io:3000","domain":".test.fider.io","environment":"test","globalAssetsURL":"https://demo.test.fider.io:3000","googleAnalytics":"","hasLegal":true,"mode":"multi","oauth":[],"tenantAssetsURL":"https://demo.test.fider.io:3000"},"tenant":null,"title":"My Page Title · Fider","user":{"avatarBlobKey":"","avatarType":"gravatar","avatarURL":"https://demo.test.fider.io:3000/avatars/gravatar/5/Jon%20Snow","email":"[email protected]","id":5,"isAdministrator":true,"isCollaborator":true,"name":"Jon Snow","role":"administrator","status":"active"}}
+ {"contextID":"CONTEXT_ID","description":"My Page Description","props":{},"sessionID":"","settings":{"assetsURL":"https://demo.test.fider.io:3000","baseURL":"https://demo.test.fider.io:3000","domain":".test.fider.io","environment":"test","googleAnalytics":"","hasLegal":true,"mode":"multi","oauth":[]},"tenant":null,"title":"My Page Title · Fider","user":{"avatarBlobKey":"","avatarType":"gravatar","avatarURL":"https://demo.test.fider.io:3000/avatars/gravatar/5/Jon%20Snow","email":"[email protected]","id":5,"isAdministrator":true,"isCollaborator":true,"name":"Jon Snow","role":"administrator","status":"active"}}
</script>
diff --git a/app/services/sqlstore/postgres/common.go b/app/services/sqlstore/postgres/common.go
index 8670e94dd..56eabe764 100644
--- a/app/services/sqlstore/postgres/common.go
+++ b/app/services/sqlstore/postgres/common.go
@@ -74,8 +74,8 @@ func buildAvatarURL(ctx context.Context, avatarType enum.AvatarType, id int, nam
}
if avatarType == enum.AvatarTypeCustom {
- return web.TenantAssetsURL(ctx, "/images/%s", avatarBlobKey)
+ return web.AssetsURL(ctx, "/images/%s", avatarBlobKey)
} else {
- return web.TenantAssetsURL(ctx, "/avatars/%s/%d/%s", avatarType.String(), id, url.PathEscape(name))
+ return web.AssetsURL(ctx, "/avatars/%s/%d/%s", avatarType.String(), id, url.PathEscape(name))
}
}
diff --git a/public/index.tsx b/public/index.tsx
index 6aee01f3f..bb9efaaab 100644
--- a/public/index.tsx
+++ b/public/index.tsx
@@ -36,7 +36,7 @@ window.addEventListener("error", (evt: ErrorEvent) => {
const fider = Fider.initialize()
__webpack_nonce__ = fider.session.contextID
- __webpack_public_path__ = `${fider.settings.globalAssetsURL}/assets/`
+ __webpack_public_path__ = `${fider.settings.assetsURL}/assets/`
const config = resolveRootComponent(location.pathname)
document.body.className = classSet({
diff --git a/public/models/settings.ts b/public/models/settings.ts
index 298970e06..cab2942b6 100644
--- a/public/models/settings.ts
+++ b/public/models/settings.ts
@@ -16,8 +16,7 @@ export interface SystemSettings {
domain: string
hasLegal: boolean
baseURL: string
- tenantAssetsURL: string
- globalAssetsURL: string
+ assetsURL: string
oauth: OAuthProviderOption[]
}
diff --git a/public/services/utils.ts b/public/services/utils.ts
index f68849f4e..c01bd3084 100644
--- a/public/services/utils.ts
+++ b/public/services/utils.ts
@@ -130,9 +130,9 @@ export const isCookieEnabled = (): boolean => {
export const uploadedImageURL = (bkey: string | undefined, size?: number): string | undefined => {
if (bkey) {
if (size) {
- return `${Fider.settings.tenantAssetsURL}/images/${bkey}?size=${size}`
+ return `${Fider.settings.assetsURL}/images/${bkey}?size=${size}`
}
- return `${Fider.settings.tenantAssetsURL}/images/${bkey}`
+ return `${Fider.settings.assetsURL}/images/${bkey}`
}
return undefined
}
diff --git a/views/base.html b/views/base.html
index bda0f6543..9199c15a0 100644
--- a/views/base.html
+++ b/views/base.html
@@ -11,7 +11,7 @@
{{ end }}
{{ if .private.assets }}
{{range .private.assets.CSS}}
- <link rel="stylesheet" href="{{ $.public.settings.globalAssetsURL }}{{ . }}" />
+ <link rel="stylesheet" href="{{ $.public.settings.assetsURL }}{{ . }}" />
{{end}}
{{end}}
{{block "head" .}}{{end}}
@@ -52,7 +52,7 @@
{{template "end-of-body" .}}
{{ if .public.tenant }}
{{ if .public.tenant.CustomCSS }}
- <link rel="stylesheet" href="{{ .public.settings.tenantAssetsURL }}/custom/{{ .public.tenant.CustomCSS | md5 }}.css" />
+ <link rel="stylesheet" href="{{ .public.settings.assetsURL }}/custom/{{ .public.tenant.CustomCSS | md5 }}.css" />
{{ end }}
{{ end }}
</body>
diff --git a/views/index.html b/views/index.html
index 53ee7221c..d30346d63 100644
--- a/views/index.html
+++ b/views/index.html
@@ -1,10 +1,10 @@
{{define "head"}}
{{ if .private.chunkAssets }}
{{range .private.chunkAssets.CSS}}
- <link rel="preload" href="{{ $.public.settings.globalAssetsURL }}{{ . }}" as="style" />
+ <link rel="preload" href="{{ $.public.settings.assetsURL }}{{ . }}" as="style" />
{{end}}
{{range .private.chunkAssets.JS}}
- <link rel="preload" href="{{ $.public.settings.globalAssetsURL }}{{ . }}" as="script" />
+ <link rel="preload" href="{{ $.public.settings.assetsURL }}{{ . }}" as="script" />
{{end}}
{{end}}
{{end}}
@@ -27,7 +27,7 @@
{{define "end-of-body"}}
{{ if .private.assets }}
{{range .private.assets.JS}}
- <script src="{{ $.public.settings.globalAssetsURL }}{{ . }}" crossorigin="anonymous"></script>
+ <script src="{{ $.public.settings.assetsURL }}{{ . }}" crossorigin="anonymous"></script>
{{end}}
{{end}}
{{end}}
\ No newline at end of file
diff --git a/views/ssr.html b/views/ssr.html
index e13a4c694..0562a6897 100644
--- a/views/ssr.html
+++ b/views/ssr.html
@@ -1,7 +1,7 @@
{{define "head"}}
{{ if .private.chunkAssets }}
{{range .private.chunkAssets.CSS}}
- <link rel="stylesheet" href="{{ $.public.settings.globalAssetsURL }}{{ . }}" />
+ <link rel="stylesheet" href="{{ $.public.settings.assetsURL }}{{ . }}" />
{{end}}
{{end}}
{{end}}