I having trouble getting iisnode to run my node application. My directory structure is
iis-site
-client
-server
-server.js
How can I get iisnode to point to a nested .js file? I tried this, but it servers the server.js instead of executing it.
<handlers>
<add name="iisnode" path="server\server.js" verb="*" modules="iisnode" />
</handlers>
and
<rule name="default">
<match url="/*" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Rewrite" url="server/server.js" />
</rule>
I ended up posting this as an issue on the GitHub project and got an answer there.
Basically, the approach is to keep a
.js
file in the root of the directory that requires the.js
that bootstraps your application.Ex:
and
and in
iisnode.js
there is one line of code:require(__dirname + '\\server\\server.js');
I struggled it with a bit and here is my solution without any additional file
Handler
Rewite rule
So as you can see my app entry point is in dist/index.js
Gabor