node.jsreactjsiishost

How to host React.js and Node.js app in windows IIS?


i am trying to upload react.js app on cloud which have windows os installed . How can i upload and start my react app Using windows IIS.


Solution

  • First, you need to install the node on the windows:

    https://nodejs.org/en/download/

    install IIS by following these steps:

    https://learn.microsoft.com/en-us/iis/install/installing-iis-85/installing-iis-85-on-windows-server-2012-r2

    after installing node and iis open command prompt as administrator and enter to the react js application folder.

    example:

    my react js application is under the C:\windows\system32\

    to go to that path use command:

    cd C:\windows\system32\my-app
    

    run react app using :

    npm start
    

    check that application is running properly or not.

    then run the command:

    npm run build
    

    You can see the build folder in your application folder.

    note: select the build folder when you add site path.

    enter image description here

    enter image description here

    enter image description here