Connect an IISNode express server to an existing front end

104 Views Asked by At

I am hosting an express server with IIS Node. If I create a brand new site in IIS I can see the express server at the following url: email.local; however if I try to add that same exact server as an application inside of the site that hosts my front end I am not able to run the server or send postman requests to it. Postman responds with a 404 error when sending an api request over https and a 403 error when sending the request over http. and my browser just shows the following: "can not GET /api/"

To be clear I want to be able to interact with this server when I navigate to www.mysite.com/api

Here is my webpack config file:

<configuration>
<system.webServer>
    <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>
        <outboundRules>
            <preConditions>
                <preCondition name="ResponseIsHtml1">
                    <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
                </preCondition>
            </preConditions>
        </outboundRules>
    </rewrite>
</system.webServer>
0

There are 0 best solutions below