|
@@ -2,6 +2,8 @@ package main
|
2
|
2
|
|
3
|
3
|
import (
|
4
|
4
|
"fmt"
|
|
5
|
+ "isogoblog/common"
|
|
6
|
+ "isomorphicgo/isokit"
|
5
|
7
|
"net/http"
|
6
|
8
|
"os"
|
7
|
9
|
|
|
@@ -18,11 +20,17 @@ func main() {
|
18
|
20
|
os.Exit(1)
|
19
|
21
|
}
|
20
|
22
|
|
21
|
|
- fs := http.FileServer(http.Dir(WebAppRoot + "/static"))
|
|
23
|
+ env := common.Env{}
|
|
24
|
+ ts := isokit.NewTemplateSet()
|
|
25
|
+ ts.GatherTemplates()
|
|
26
|
+ env.TemplateSet = ts
|
22
|
27
|
r := mux.NewRouter()
|
23
|
28
|
r.HandleFunc("/", handlers.IndexHandler)
|
24
|
|
- r.HandleFunc("/js/client.js", handlers.GopherjsScriptHandler)
|
25
|
|
- r.HandleFunc("/js/client.js.map", handlers.GopherjsScriptMapHandler)
|
|
29
|
+ r.HandleFunc("/js/client.js", isokit.GopherjsScriptHandler)
|
|
30
|
+ r.HandleFunc("/js/client.js.map", isokit.GopherjsScriptMapHandler)
|
|
31
|
+ r.Handle("/template-bundle", handlers.TemplateBundleHandler(&env))
|
|
32
|
+
|
|
33
|
+ fs := http.FileServer(http.Dir(WebAppRoot + "/static"))
|
26
|
34
|
http.Handle("/", r)
|
27
|
35
|
http.Handle("/static/", http.StripPrefix("/static", fs))
|
28
|
36
|
http.ListenAndServe(":8080", nil)
|