forked from tjanczuk/iisnode
-
Notifications
You must be signed in to change notification settings - Fork 99
Open
Description
To use iisnode with an Angular 17 SSR application, follow these steps:
Install the latest versions of iisnode and node.js.
By default, iisnode cannot handle .mjs files. To overcome this problem, change the last line of the interceptor.js (C:\Program Files\iisnode) file to :
require('child_process').spawn(process.argv[0], process.argv.slice(1));Copy all the files in the dist folder into the directory that will serve your application.
Create a web.config file at the rout of this directory with the following contents:
<configuration>
<system.webServer>
<handlers>
<add name="iisnode" path="server/server.mjs" verb="*" modules="iisnode" />
</handlers>
<rewrite>
<rules>
<rule name="StaticFiles" stopProcessing="true">
<match url=".*\.(css|jpg|png|gif|js|ico|html|svg|json|woff|woff2|ttf|webp|webmanifest)$" />
<action type="Rewrite" url="browser/{R:0}" />
</rule>
<rule name="DynamicContent">
<match url="/*" />
<action type="Rewrite" url="server/server.mjs" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>Your Angular 17 SSR application should be well served!
Metadata
Metadata
Assignees
Labels
No labels