router_static.go: inject CDN_PREFIX in JS files

This commit is contained in:
Adhityaa 2018-06-03 20:48:29 +05:30
parent 02f134932f
commit 79f39f8094

View File

@ -46,7 +46,8 @@ func initStaticRouter(router *mux.Router) error {
prefix := "" prefix := ""
if dir == "js" { if dir == "js" {
prefix = "window.origin='" + os.Getenv("ORIGIN") + "';" prefix = "window.origin='" + os.Getenv("ORIGIN") + "';\n"
prefix += "window.cdn='" + os.Getenv("CDN_PREFIX") + "';\n"
} }
asset[p] = prefix + string(contents); asset[p] = prefix + string(contents);