Reputation: 39
I have developed an application using nodejs & react. I want to host my application using the same Port: 3000 on IIS server?
Upvotes: 2
Views: 3094
Reputation: 12814
First, you need to install the node on the windows:
https://nodejs.org/en/download/
install IIS by following these steps:
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 the application is running properly or not.
then run the command:
npm run build
You can see the build folder in your application folder.
in add website windows enter details like site name folder path the port number, IP address, hostname, etc
note: select the build folder when you add the site path.
Open site by click on the browse button from the action pane.
Upvotes: 0
Reputation: 487
I would just comment, but my reputation is a little low.
The best option for you would be to run IISNode. Supported by MS and available on Github here: https://github.com/Azure/iisnode.
Upvotes: 1