Skip to content

Instantly share code, notes, and snippets.

@riskers riskers/README.md
Last active Apr 9, 2019

Embed
What would you like to do?
前后端分离

simple

  • 开发: devServer || CORS
  • 部署: nginx

web -> nginx -> Java


https://github.com/Big-Chinese-Cabbage/interest 为例,他是分成两个文件夹做前后端分离:

  • server: 后端
  • web: 前端

然后是用 nginx 转发端口

在公司实际实践上,完全可以做 Docker 容器来分开

前端直接在 CI 步骤上发布到 CDN 上,然后后端可以部署容器更新 CDN 资源版本即可


complex

  • 开发: devServer || CORS
  • 部署: Node.js

Node 这一层作为有『逻辑』的 Nginx ,可以把后端变量输出在模板上。


web -> Node -> Java


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.