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

Registering the server-side handlers

After we have initialized the template set inside the main function of the igweb.go source file, we create a new Gorilla Mux router, and we call the registerRoutes function to register all the routes of the server-side web application. Let's examine the lines of the registerRoutes function that are essential for the proper functioning of the client-side web application:

// Register Handlers for Client-Side JavaScript Applicationr.Handle("/js/client.js", isokit.GopherjsScriptHandler(WebAppRoot)).Methods("GET")r.Handle("/js/client.js.map", isokit.GopherjsScriptMapHandler(WebAppRoot)).Methods("GET")// Register handler for the delivery of the template bundler.Handle("/template-bundle", handlers.TemplateBundleHandler(env)).Methods("POST") ...

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