Writing an RESTful API in beego

xuanbao · · 1445 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I was looking into beego for writing a RESTful API for one of my projects. I set up the quickstarter beego project and also the autogenerated API project. I see Namespaces and Annotation routers, I would like to know the advantages on using these(NS etc) instead of the normal routers that I get during quickstart. </p> <p>Quickly pointout the advantages of Namespaces, NSInclude etc.</p> <p>EDIT: I got it, I understaood Namespaces, NSInclude. But I am more curious on the annotation routers,(@router , @params etc). Can someone elaborate it. For instance for /user, inside the UserCOntroller, top of Get(), we ll use </p> <p>&#39;@router /:uid [PUT]&#39;</p> <p>beego decides on this comment? Thats so screwy, specifying the secondary routes on comments. </p> <hr/>**评论:**<br/><br/>grimborg: <pre><p>I&#39;m not familiar with beego, but you may be better off skipping it and just using the standard library.</p> <p>Check out <a href="http://thenewstack.io/make-a-restful-json-api-go/" rel="nofollow">http://thenewstack.io/make-a-restful-json-api-go/</a> for example.</p> <p>Check out also the <a href="http://www.gorillatoolkit.org/" rel="nofollow">gorilla toolkit</a>. mux and schema may be particularly useful in your case.</p></pre>Bromlife: <pre><p>That&#39;s the thing I don&#39;t understand, these frameworks really don&#39;t provide a lot of functionality that can&#39;t easily be replicated by the standard library. If you&#39;re just starting out with Go, you should definitely learn the standard library before you start bringing in monolithic frameworks. Then, once you&#39;ve learnt the basics of the standard library you are in the position to decide whether this library is actually worth your time or not.</p> <p>Which of course, it isn&#39;t.</p></pre>

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

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