2

I have created Node.js application on Visual studio 2019, and I want to deploy it on IIS.

How I can deploy node.js application and Node.js express applications on IIS on local system

I have tried many solutions but none of them completely helpful The link below some how helpful but confusing and lot of content to read https://www.hanselman.com/blog/InstallingAndRunningNodejsApplicationsWithinIISOnWindowsAreYouMad.aspx

1 Answers1

0

Here some simple solution for above problem

Node.js deplyment on iss

Install IISNODE open cmd as admin cd "C:\Program Files\iisnode" (or "C:\Program Files (x86)\iisnode" if you installed the 32bit version

Type setupsamples.bat

Install MS URL rewrite using web installer

add web.config with code

<configuration>
                    <system.webServer>

                        <!-- indicates that the server.js file is a node.js application
                        to be handled by the iisnode module -->

                        <handlers>
                            <add name="iisnode" path="server.js" verb="*" modules="iisnode" />
                        </handlers>

                        <rewrite>
                            <rules>
                                <rule name="sendToNode">
                                    <match url="/*" />
                                    <action type="Rewrite" url="server.js" />
                                </rule>
                            </rules>
                        </rewrite>

                    </system.webServer>
                </configuration>

publish node.js project

paste published site on inetpub-->wwwroot run cmd as admin run command on website folder For node
npm install For Node Express npm install express Create IIS website start browsing