React.js - 如何独立或一起部署客户端和服务器? [英] React.js - How to deploy client and server independently or together?

查看:34
本文介绍了React.js - 如何独立或一起部署客户端和服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 react.js 网站,后端在 Node/express 中托管在 Azure 上,现在该项目是整体式的,每次我在前端或后端进行更改时,所有内容都会重新部署到生产中.我想要实现的是,每当我在 github 上推送更改时,都能够彼此独立地部署前端和后端,而且如果它们都受到影响,请将它们部署在一起以避免不一致.您是否知道一些最佳实践或服务来实现这一目标?谢谢

I have a react.js website with a backend in Node/express hosted on Azure, right now the project is monolithic, every time I do a change in the front or backend everything is redeployed in production. What I would like to achieve is to be able to deploy the frontend and the backend independently from one another whenever I push a change on github, but also if they are both affected deploy them together to avoid inconsistencies. Do you know some best practices or services to achieve this? Thanks

推荐答案

Azure 应用服务的 git 部署方法很简单.但是,只要我们修改该文件,就会执行所有部署命令,并开始整个部署过程.这是无法更改的.

The git deployment method of Azure app services is simple. However, as long as we modify the file, all deployment commands will be executed and the entire deployment process will start. This cannot be changed.

根据你的描述,我大概知道你的项目是前后端融合,没有前后端分离.所以我猜,你想为前端应用和后端应用使用相同的应用服务.

Based on your description, I probably know that your project is a fusion of front and back ends, without separation of front and back ends. So I guess, you want to use the same app services for the front-end app and the back-end app.

所以我建议你还是把项目的前端和后端分开.这是主流.也方便后期的维护和扩展.如果只是想使用webapp服务,可以使用基于windows环境的webapp,直接使用虚拟应用即可.这样,更新程序就可以完全分离,没有任何影响.

So I suggest that you still separate the front and back ends of the project. This is the mainstream. It is also convenient for later maintenance and expansion. If you just want to use a webapp service, you can use a webapp based on the windows environment, and just use a virtual application. In this way, the update program can be completely separated without any impact.

注意,目前我发现虚拟应用不支持react项目,已经提出支持票确认.如果有任何进展,我会告诉你.

这篇关于React.js - 如何独立或一起部署客户端和服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆