Golang for web application

agolangf · · 692 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>Hello there, it is the first topic on reddit at all and sorry me if not the place where discuss such articles.</p> <p>I want to write a high-load project somehow similar to SoundCloud and still looking around for a good language to start writing it on and currently stopped on golang. So my question is: &#34;Is golang good for writing full web application (service, API, etc.) from scratch?&#34;</p> <hr/>**评论:**<br/><br/>bluechipmonk: <pre><p>That&#39;s exactly Golang is made for. It&#39;s especially perfect for applications like Soundcloud. </p></pre>romain_vanesyan: <pre><p>Okay, but I catch sight of that golang is not too good for web app front-end. How do you solve such a purpose? Or do you use golang for both internal services and for serving through the web?</p></pre>koalainthetree: <pre><p>Go is amazing for RESTful APIs it&#39;s not as good for rapid front-end as say django.</p> <p>Front-end I would write in whatever frontend framework you use and consume the API</p></pre>beeker1121: <pre><p>Go actually handles both, just like any other web server application. An HTTP request will come in to routes you define in Go (/page for example), and via your Go code you decide what to do on the backend, such as retrieving or saving data to your database. Finally, you serve up the frontend as a response to the request.</p> <p>Serving the frontend of your site to visitors could be as simple as writing a text response to the request (i.e. someone visits <a href="http://yoursite.com/page" rel="nofollow">http://yoursite.com/page</a> in a browser and you use Go to simply respond with &#39;Hello&#39;), serving up a static file (page.html), or you can use Go&#39;s html/template package to serve dynamic HTML. The frontend then can be built using standard HTML, CSS, and JS, or you could use React, etc - it&#39;s up to you.</p> <p>Go is also great for creating whatever service you need on the backend; creating a web server is just one of the things you can do with it (and the standard libraries in Go you can use to develop web applications, net/http, html/template, etc are amazing).</p></pre>pwn4d: <pre><p>I made my own app using <a href="https://github.com/haruyama/golang-goji-sample" rel="nofollow">golang-goji-sample</a> as a base and ended up liking golang for web apps a lot. Give it a try and see.</p></pre>lpalmes: <pre><p>Yes, it is my favorite server language cause of the simplicity and performance of the language.</p> <p>Here are two gitbooks you might find useful, * <a href="https://codegangsta.gitbooks.io/building-web-apps-with-go/" rel="nofollow">One rather short</a> * <a href="https://astaxie.gitbooks.io/build-web-application-with-golang/content/en/index.html" rel="nofollow">And a more detailed one</a></p> <p>Hope it serves you well, and hope to see your project up and running!</p></pre>misterG113: <pre><p>There are a bunch of libs you could use for it. Just have a look to <a href="https://github.com/avelino/awesome-go#web-frameworks" rel="nofollow">https://github.com/avelino/awesome-go#web-frameworks</a></p></pre>valyala: <pre><p>Take a look at <a href="https://github.com/valyala/quicktemplate" rel="nofollow">quicktemplate</a> for writing non-trivial yet clean and fast html templates. This is usually an essential part of real-life web applications.</p></pre>thewhitetulip: <pre><p>If you are new to webapps, I am in the middle of writing an intro book, you can contribute to it if you want: <a href="http://github.com/thewhitetulip/web-dev-golang-anti-textbook/" rel="nofollow">http://github.com/thewhitetulip/web-dev-golang-anti-textbook/</a></p></pre>afghanPower: <pre><p>Parts of that book are extremely similar to astaxie&#39;s book..?</p></pre>dlsniper: <pre><p>The language is named Go not Golang Go Lang or any other combination / derivation. Why is this so hard to understand????? </p></pre>samsonx: <pre><p>It&#39;s not a great word to search for on its own.</p></pre>TwistU2: <pre><p>this.</p></pre>dlsniper: <pre><p>So what? You are in the Go thread on Reddit posting a Go related thing. How is that a search problem? And even if you post a blog post, you can still have tags for it (and the search engines are supposed to be smart enough to pick it up correctly). </p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

692 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传