O'Reilly logo

Isomorphic Go by Kamesh Balasubramanian

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Setting up the server-side route

We've registered the /localstorage-demo route inside the registerRoutes function found in the igweb.go source file:

r.Handle("/localstorage-demo", handlers.LocalStorageDemoHandler(env)).Methods("GET")

We've defined the LocalStorageDemoHandler server-side handler function to service the /localstorage-demo server-side route in the localstoragedemo.go source file found in the handlers folder:

package handlersimport (  "net/http"  "github.com/EngineerKamesh/igb/igweb/common"  "github.com/isomorphicgo/isokit")func LocalStorageDemoHandler(env *common.Env) http.Handler {  return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { env.TemplateSet.Render("localstorage_example_page", &isokit.RenderParams{Writer: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required