4 ms·
Do you know of any recent tutorials on writing web applications in Golang? I saw a slideshow from two years ago, but the content seemed to be fairly abstract fo
by lhnn 15y ago
Do you know of any recent tutorials on writing web applications in Golang? I saw a slideshow from two years ago, but the content seemed to be fairly abstract for a framework.
- canop_fr 15y agoIt really depends on your needs and the type of application you're making. For example my applications, apart serving a few static html, css and js files, just answer to JSON or JSONP queries. That can be done in a dozen lines of code, all the remaining code will be related to your application logic. So you just need to look at the net/http API, and at a few code samples. I cannot find the the old golang wiki codelab sample (has it gone away with Go1 ?), so here's an example of a JSONP server that you can reduce to a few lines if you remove the specific application logic and the profiling hook : https://github.com/Canop/braldop/blob/master/go/src/braldopserver/BraldopServer.go https://github.com/Canop/braldop/blob/master/go/src/braldops... EDIT : I found an example on the golang site. If you're not interested in JSON, it will be more suited to your need : http://golang.org/doc/effective_go.html#web_server http://golang.org/doc/effective_go.html#web_server