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

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

问题描述

我有一个React.js网站,其后端托管在Azure上的Node/express中,现在该项目是单片的,每当我对前端或后端进行更改时,一切都会重新部署到生产中.我想实现的目标是,每当我在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.

因此,我建议您仍将项目的前端和后端分开.这是主流.这对于以后的维护和扩展也很方便.如果您只想使用Web应用程序服务,则可以使用基于Windows环境的Web应用程序,而仅使用虚拟应用程序.这样,更新程序可以完全分离而不会产生任何影响.

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天全站免登陆