Web Application Project Based on Golang

polaris · 2017-06-20 01:01:02 · 890 次点击    
这是一个分享于 2017-06-20 01:01:02 的资源,其中的信息可能已经有所发展或是发生改变。

Within the build of a web application based on Golang, I try to find a balance between how to expose my files and folders. The project should contain tree directories: app, backend, api. app is the directory that hosts all frontend staff. May I create a single for the whole project, may I separate them. I think that you full stack developer you could help me and share with me a complete tree to most of web applications.


评论:

shovelpost:

Lately I've been separating my Single Page web apps into two repositories. One that has pure Go API code and the other that has pure HTML/JavaScript/CSS frontend code. It has been working well for me.

RevMen:

This is what I do, too. I think there are good reasons to keep them separate.

The front and the back really are separate applications that communicate. It's possible to write/test/deploy them from completely separate machines/environments.

It's possible to write different front ends that communicate with the same back end. Putting all of those different front ends into the same repo would be messy.

The front and back ends can be deployed to different machines.

kiwibokbok:

I like this approach, we have been using it with some non-golang backed projects and it's allowing great separation and testing.

jackmcmorrow:

I think your dir structure is ok, but I'm that guy that has backend and frontend in the same folder (which I probably shouldn't do, especially for security purposes

adamkw94:

Maybe do app, model (API), controller


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

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