3 ms·
Rest API? Sure. Building webpages? I dont think it was made for that... Although Go templates can work, its still not as flexible as you might want it to be.
by diamondo25 8y ago
Rest API? Sure. Building webpages? I dont think it was made for that... Although Go templates can work, its still not as flexible as you might want it to be.
- sam0x17 8y agoThen again these days maybe that is enough for some people. I know a lot of people are eschewing server side page generation entirely for some static js and assets sitting in an S3 bucket that talks to an API server. The only barrier now is SEO, and people are coming up with all sorts of creative solutions to deal with that, as the search engine bots themselves get better and better at indexing js content. That said, I sort of hate frontend js frameworks. You can do everything I just said without them, and really, we should have been doing it for years, like even pre-2010, but we were just too caught up in this markup = server side mentality to really operate that way. Part of it, I think, was that CDNs are a sort of recent thing, and before them you were always running a server anyway, so why not generate the page server side if you're going to go to that much trouble. Also client-side capabilities have dramatically increased, and then you have HTML 5 to consider.
- deleted 8y ago[deleted]
- nkozyra 8y agoIt's pretty flexible in my opinion. And you can substitute go templates for another template library if you like. Granted, we're talking about largely server side generated web pages and, haha, who does THAT still in 2019 : hangs head in shame :
- 52-6F-62 8y agoIt's true. I don't often do so at work anymore, either—except for utility pages. But I am rewriting my personal site/blog in Go as a trial run/learning process. I've been critical of Go in the past so I thought I'd give it a... go. So far I don't mind the experience. No server framework, either. The standard library is actually pretty good, at least for something simple like that. The only [external] dependency I'm pulling in so far is `blackfriday` for parsing Markdown files (the posts) upon request— I'm much too lazy to write a Markdown parser myself for this purpose. It's not finished yet, but it's on its way— https://github.com/robertfairley/rf-19-go https://github.com/robertfairley/rf-19-go