Deploying of NodeJS Express Typescript API on IIS

ABGS Technical Support 0 Reputation points
2025-01-13T06:02:25.0633333+00:00

I'm trying to deploy my NodeJS Express Typescript API App on my IIS. While searching, I came across using the iisnode which is outdated and not maintained module these past few year. Also I came accross using reverse proxy. What is the best way or more efficient way to deploy my app in iis? Thanks a lot.

Internet Information Services
{count} votes

1 answer

Sort by: Most helpful
  1. JasonPan - MSFT 6,276 Reputation points Microsoft Vendor
    2025-01-14T06:21:19.7433333+00:00

    Hi @ABGS Technical Support,

    1.Build the project and we can find the publish files inside dist folder.

    User's image

    2.Create a site in IIS and set the physical path to E:\repos\Nodejs\typescript-express-api\dist.

    3.The publish files should like below.

    User's image

    4.The content of web.config.

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <system.webServer>
            <handlers>
                <add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" requireAccess="Script" />
            </handlers>
            <httpPlatform stdoutLogEnabled="true" stdoutLogFile=".\node.log" startupTimeLimit="20" processPath="E:\Program Files\nodejs\node.exe" arguments=".\index.js">
                <environmentVariables>
                    <environmentVariable name="PORT" value="%HTTP_PLATFORM_PORT%" />
                    <environmentVariable name="NODE_ENV" value="Production" />
                </environmentVariables>
            </httpPlatform>
        </system.webServer>
    </configuration>
    
    1. Test Result.

    User's image

    Tip:

    We can find the nodejs installed path by command: where node


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best regards

    Jason


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.