Angular/cliでビルドしたdistファイルをGAE/GOで描画したいのですが、うまく行きません。
やっていることは、
func init() { http.Handle("/", &templateHandler{filename: "index.html"}) http.HandleFunc("/api/", restHandler) }
type templateHandler struct { once sync.Once filename string tpl *template.Template } func (t *templateHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { t.once.Do(func() { t.tpl = template.Must(template.ParseFiles(filepath.Join("templates", t.filename))) }) t.tpl.Execute(w, nil) }
templatesフォルダーにdistのファイルを入れてindex.htmlを描画できると思ったのですが下記のエラーにつまずいてしまいます。
Uncaught SyntaxError: Unexpected token
フロントサイドはAngularでサーバーサイドはGAE/GOでやっている方いらっしゃったらどのような感じでやっているのか教えてください。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/06/01 04:46
2017/06/01 09:06
2017/06/05 00:22