|
@@ -2,13 +2,16 @@ package isokit
|
2
|
2
|
|
3
|
3
|
import (
|
4
|
4
|
"net/http"
|
5
|
|
- "os"
|
6
|
5
|
)
|
7
|
6
|
|
8
|
|
-func GopherjsScriptHandler(w http.ResponseWriter, r *http.Request) {
|
9
|
|
- http.ServeFile(w, r, os.Getenv("ISOGO_APP_ROOT")+"/client/client.js")
|
|
7
|
+func GopherjsScriptHandler(webAppRoot string) http.Handler {
|
|
8
|
+ return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
9
|
+ http.ServeFile(w, r, webAppRoot+"/client/client.js")
|
|
10
|
+ })
|
10
|
11
|
}
|
11
|
12
|
|
12
|
|
-func GopherjsScriptMapHandler(w http.ResponseWriter, r *http.Request) {
|
13
|
|
- http.ServeFile(w, r, os.Getenv("ISOGO_APP_ROOT")+"/client/client.js.map")
|
|
13
|
+func GopherjsScriptMapHandler(webAppRoot string) http.Handler {
|
|
14
|
+ return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
15
|
+ http.ServeFile(w, r, webAppRoot+"/client/client.js.map")
|
|
16
|
+ })
|
14
|
17
|
}
|