reactjsiis

Deploy ReactJS on IIS within subfolder


I have a production build of ReactJS app. I want to deploy it on IIS server. Example: 192.168.1.1/myreactapp

I want to access to the reactapp in the above url but it returns blank page.

If I put the physical path to the build folder, it opens the ReactApp but on 192.168.1.1 instead.


Solution

  • The solution is add homepage:"" in the package.json. Eg: homepage:"php/hello" Then npm build the app and copy the contents of the build folder to php/hello directory. The web can then be accessed.