From 79f39f8094fc9fbe54cb7d024c3f85ea098e0562 Mon Sep 17 00:00:00 2001 From: Adhityaa Date: Sun, 3 Jun 2018 20:48:29 +0530 Subject: [PATCH] router_static.go: inject CDN_PREFIX in JS files --- api/router_static.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/router_static.go b/api/router_static.go index ee1b6b7..868cb4f 100644 --- a/api/router_static.go +++ b/api/router_static.go @@ -46,7 +46,8 @@ func initStaticRouter(router *mux.Router) error { prefix := "" 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);