Common isomorphic functionality in one kit.

gopherjshandlers.go 436B

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