如何在 IIS 或 Window 服务器上托管 React.js Web 应用程序?
How to host React.js Web Application on IIS or Window Server?
我刚开始在 Window 服务器上部署 React.js Web 应用程序。如何在 IIS 上托管 react.js Web 应用程序?
非常欢迎您的建议。谢谢
不确定你是如何编译你的代码的,但通常你的解决方案中应该有一个 public 文件夹,所以静态文件就在那里,只需在 IIS 上设置这个 public 文件夹在您喜欢的路线上提供静态文件。
当然,这解决了如何服务 html/css 和反应编译脚本,但你需要更进一步才能访问浏览器端反应使用的 api,并且这取决于您为此使用的框架。
我对这个主题进行了大量研究,发现我必须将这些信息拼凑起来。这个博客和其他几个博客让我知道我需要在 Windows Server 2008 上托管一个 React 应用程序。首先,我使用 Windows 2008 Service Pack 2 在 AWS 中创建了一个 AMI,这个视频来自 Brett Beck How To Setup Windows Server With Amazon Web Services (AWS) EC2. Then I needed to research installing node.js on Windows Server 8, I found this article to be extremely helpful. Admin Ahead Blog by CHETAN SINGH. Then installing IIS correctly on Windows 8: Installing IIS Correctly on Windows Server R2。
我能够通过将我的默认文档指向 ./dist 文件夹来部署我的反应样板,其中 index.html 是主要文件。
我刚开始在 Window 服务器上部署 React.js Web 应用程序。如何在 IIS 上托管 react.js Web 应用程序?
非常欢迎您的建议。谢谢
不确定你是如何编译你的代码的,但通常你的解决方案中应该有一个 public 文件夹,所以静态文件就在那里,只需在 IIS 上设置这个 public 文件夹在您喜欢的路线上提供静态文件。
当然,这解决了如何服务 html/css 和反应编译脚本,但你需要更进一步才能访问浏览器端反应使用的 api,并且这取决于您为此使用的框架。
我对这个主题进行了大量研究,发现我必须将这些信息拼凑起来。这个博客和其他几个博客让我知道我需要在 Windows Server 2008 上托管一个 React 应用程序。首先,我使用 Windows 2008 Service Pack 2 在 AWS 中创建了一个 AMI,这个视频来自 Brett Beck How To Setup Windows Server With Amazon Web Services (AWS) EC2. Then I needed to research installing node.js on Windows Server 8, I found this article to be extremely helpful. Admin Ahead Blog by CHETAN SINGH. Then installing IIS correctly on Windows 8: Installing IIS Correctly on Windows Server R2。
我能够通过将我的默认文档指向 ./dist 文件夹来部署我的反应样板,其中 index.html 是主要文件。