简体   繁体   English

React.js - 如何独立或一起部署客户端和服务器?

[英]React.js - How to deploy client and server independently or together?

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.我有一个 react.js 网站,后端在 Azure 上托管在 Node/express 中,现在该项目是整体的,每次我在前端或后端进行更改时,所有内容都会重新部署到生产环境中。 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.我想要实现的是,每当我在 github 上推送更改时,都能够独立部署前端和后端,但如果它们都受到影响,也可以将它们部署在一起以避免不一致。 Do you know some best practices or services to achieve this?您是否知道实现此目标的一些最佳实践或服务? Thanks谢谢

The git deployment method of Azure app services is simple. Azure app服务的git部署方法很简单。 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.所以我想,您想为前端应用程序和后端应用程序使用相同的应用程序服务。

在此处输入图像描述

在此处输入图像描述

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.如果只想使用webapp服务,可以使用基于windows环境的webapp,使用虚拟应用即可。 In this way, the update program can be completely separated without any impact.这样,更新程序就可以完全分离,不会有任何影响。

Note that at present I found that the virtual application does not support the react project and has raised a support ticket to confirm.注意,目前我发现虚拟应用不支持react项目,已经提了support ticket确认。 If have any progress, I will tell you.如果有任何进展,我会告诉你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 服务器端和客户端端的路由-React.js和Node.js - Routes on server & client side - React.js & Node.js 如何在 IIS 中部署带有 Node 后端的 React.js? - How to deploy React.js with Node backend in IIS? 在Openshift上部署React.js入门套件 - Deploy React.js Starter Kit on Openshift 使用 express.js 和 node.js(服务器端)和 react.js(客户端)发布查询问题 - post query issue with express.js and node.js (server side) and react.js (client side) Next.js (React.js),带有 Node.js 服务器 Socket.io 客户端多个 ID - Next.js (React.js), with Node.js server Socket.io client multiple IDs 如何使用 React.js 和后端使用 React Hooks 以及如何使用 heroku 部署它? - How to use React.js with backend using React Hooks and how to deploy it using heroku? 从 Node.JS 服务器应用程序中发出 GET 请求并将其发送到 React.JS 客户端 - Make a GET request from within a Node.JS server app and send it to React.JS client Socket.io 未将 Node.js 服务器连接到 React.js 客户端 - Socket.io is not connecting Node.js server to React.js client React.js with Express:在使用 Express 作为服务器的同时在客户端渲染一个简单的组件? - React.js with Express: Render a simple component on the client-side while using Express as a server? 使用React.js进行服务器端渲染 - Server-side rendering with React.js
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM