Skip to content

Comment on On Go’s Web Application Ecosystem

Comments

All this talk about HTML templating (html/template, etc) & Go web applications, is missing any discussion of what IMHO is a better way to write Go web apps:

1. Write a backend webservice in Go's net/http + Gorilla

2. Use something like angular JS to interact with those webservices. (From the server's perspective this means static HTML/CSS/JS assets that can again be served by Go, from memory if desired).

My first couple Go web applications did things the html/template way and were structured on the way I used to go JSF applications- but since I switched to the above approach my projects have been better performing, faster to develop , better scaling and easier to maintain. As we all know, we seldom get all those things in one technology choice without trade-offs.

That's the approach I'll be taking when writing a future side project. Fully API driven with go. Angular/Grunt/Bower for frontend, perhaps served by go or possibly on a separate machine serving just HTML, just to see how it performs.

I've even considered Github pages for the HTML. But probably not for production :)

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.