How do I go about building the backend of a web and mobile app in Go?

blov · · 506 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>If designing a web app with the view to launch mobile app later, assuming you&#39;re doing everything from scratch and have no legacy burden, how would you go about structuring everything?</p> <p>For instance, suppose you&#39;re creating a Quora or yahoo answers clone, or a wiki, or blog engine. </p> <hr/>**评论:**<br/><br/>AdamSmithLiberal: <pre><p>You could create a REST api in a Go web framework and then serve a Single Page Application (in Angular or react etc)</p></pre>shovelpost: <pre><p>Write a <a href="https://developers.google.com/web/fundamentals/codelabs/your-first-pwapp/" rel="nofollow">Progressive Web App</a> with a Go backend. It&#39;s much cheaper than developing a separate mobile app.</p></pre>Xerxero: <pre><p>Does it work on iOS yet ( service worker in the background) ? </p></pre>shovelpost: <pre><p>It works on Safari using polyfills.</p></pre>catkins88: <pre><p>Bit of a broad question.</p> <p>If you wanted something batteries included you could try something like <a href="https://gobuffalo.io/" rel="nofollow">https://gobuffalo.io/</a></p> <p>If you want something much less opinionated you could use <a href="http://www.gorillatoolkit.org/pkg/mux" rel="nofollow">http://www.gorillatoolkit.org/pkg/mux</a> and <a href="http://jmoiron.github.io/sqlx/" rel="nofollow">http://jmoiron.github.io/sqlx/</a> to get you going with an API, the build your front end using Vue or React or whatever, and reuse it when the mobile app comes up?</p></pre>deranjer: <pre><p>I started a project like that recently and decided on the gorilla websocket package and use websockets to communicate from frontend to backend using JSON (react for frontend). In retrospect gRPC might have been more useful.</p> <p>REST also should work fine and frameworks like Goa help a lot with that.</p></pre>

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

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