0

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.

Loran
  • 772
  • 4
  • 16
  • 38

1 Answers1

2

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

enter image description here

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

enter image description here

  1. Build the project to production folder.

    npm run build

enter image description here

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.

enter image description here

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

enter image description here

Brando Zhang
  • 22,586
  • 6
  • 37
  • 65
  • Thanks, I already tried this way on yesterday and its worked. So I will mark as the answer. – Loran Sep 24 '19 at 02:20