Node Expressjs api host under angular build project in iis using web.config

<configuration>
<system.webServer>
<!-- indicates that the hello.js file is a node.js application
to be handled by the iisnode module -->
<staticContent>
<remove fileExtension=".woff" />
<remove fileExtension=".json" />
<mimeMap fileExtension=".woff" mimeType="application/font-woff" />
<mimeMap fileExtension=".json" mimeType="application/json" />
</staticContent>
<!-- use URL rewriting to redirect the entire branch of the URL namespace
to hello.js node.js application; for example, the following URLs will
all be handled by hello.js:
http://localhost/node/urlrewrite/myapp
http://localhost/node/urlrewrite/myapp/foo
http://localhost/node/urlrewrite/myapp/foo/bar/baz?param=bat
-->
<handlers>
<add name="iisnode" path="api/backend/src/server.js" verb="*" modules="iisnode" />
</handlers>
<rewrite>
<rules>
<rule name="HTTPS force" enabled="true" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
</rule>
<rule name="API" stopProcessing="true">
<match url="api/*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="api/backend/src/server.js" />
</rule>
<rule name="AngularJS Routes" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="/" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
This comment has been removed by the author.
ReplyDeletePlease hold up the excellent work. We need far more this kind of webmasters such as you on the web and also much fewer spammers. Great friend!
ReplyDeleteThanks a lot for posting, it was quite helpful and told me quite a bit
sodium hypochlorite amazon
china air purifier
korean air purifier brands