React Deployment on IIS server

假装没事ソ 提交于 2021-02-11 15:49:15

问题


I would like to deploy my react app to IIS and I tried a step by step guide.

I already tried a create-react-app and I already added a new website but when I run It says:

this site can't reach

.

I tried that way but some steps are not understood.=>create-react-app on IIS 10

I am newbie and May I know step by step if possible.

Thanks.


回答1:


I suggest you could try belwo steps to host a reasct app on the IIS.

If you don't have the react app, I suggest you could install the npm and generate a react app for testing.

1.Open cmd and locate a folder by using cd yourfoldername

2.Run below command to add the package

npm i -g create-react-app

3.Run below command to create the react app in the folder, wait for creating the application

create-react-app my-app

  1. Build the project to production folder.

    npm run build

5.Open IIS management console and create a new web sites and use the build path as the physical path. for example: D:\ReactAppTest\my-app\build

Notice: You should pay attention to your port number.

  1. Then you could use that port number to access your react application. For example: http://localhost:9965/



来源:https://stackoverflow.com/questions/58057981/react-deployment-on-iis-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!