在部署时无法在Node.js应用程序与React.js应用程序之间创建通信 [英] Unable to create communication between Node.js app to React.js app while deploying

查看:74
本文介绍了在部署时无法在Node.js应用程序与React.js应用程序之间创建通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在尝试在Azure上部署MERN应用程序(React.js作为客户端和Node.js作为服务器)。我创建了一个Cosmos数据库帐户和数据库(MongoDB)并将我的Node.js应用程序连接到该数据库。

I am trying to deploy a MERN app (React.js as client & Node.js as server) on Azure. I have created A Cosmos DB Account and database (MongoDB) and connected my Node.js app to that database.


我无法在节点之间建立通信.js& React.js应用程序。

I am unable to create communication between my Node.js & React.js apps.


我创建了  构建我的React.js应用程序并粘贴在Node.js应用程序中 并部署
Node.js app。

I have created build of my React.js app and pasted in Node.js app and deploying Node.js app.


我在浏览应用网址时遇到问题

I am getting issue following issue while browsing app url



"无法获取/'

'cannot GET/'

推荐答案

要验证,是您使用Azure App Services来托管您的React.js应用程序和Node.js应用程序吗?这两个应用程序是否在同一个应用程序服务计划中?如果没有,您是否可以尝试在应用程序服务计划中找到一个应用程序的VIP(位于属性刀片下) KUDU CMD标签?

To verify, are you using Azure App Services to host your React.js app and your Node.js app? Are the two apps on the same App Service Plan? If not, can you try to tccping the one app's VIP (located under properties blade) in the KUDU CMD tab?

1.导航到sitename.scm.azurewebsites.net

1. Navigate to sitename.scm.azurewebsites.net

2.选择调试控制台> cmd

2. Select debug console>cmd

3.tcpping xxx.xxx.xxx.xxx(这是您插入对方应用程序名称的地方)

3. tcpping xxx.xxx.xxx.xxx (this is where you insert the opposing app's name)

以上将有助于验证应用程序之间是否存在虚拟机连接。如果应用程序运行在相同的应用服务计划或上述测试结果成功,则可能还有其他问题。如果您运行的是Windows,请告诉我们。 b $ b或基于Linux的App Services?

The above will help to verify that there is VM connectivity between apps. If the apps are running on the same App Service Plan or the above test results as successful, then there is likely another issue. Can you please let us know if you are running Windows or Linux based App Services?


这篇关于在部署时无法在Node.js应用程序与React.js应用程序之间创建通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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