Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to deploy Fastify REST app on windows IIS server? #1016

Open
Jitendragit2019 opened this issue Mar 18, 2024 · 2 comments
Open

How to deploy Fastify REST app on windows IIS server? #1016

Jitendragit2019 opened this issue Mar 18, 2024 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@Jitendragit2019
Copy link

馃挰 Request help on deploying fastify rest app on windows IIS server

We have developed a REST API with using Node JS Fastify framework. All works great when we run through local server. But it get several errors when we deploye on IIS server on windows.

[RangeError: "port" argument must be >= 0 and < 65536]

Your Environment

  • node version: 21.7.1
  • fastify version: >=4.20.4
  • os: Windows
  • any other relevant information
@Jitendragit2019 Jitendragit2019 added the help wanted Extra attention is needed label Mar 18, 2024
@melroy89
Copy link
Contributor

I assume you didn't set a port..? Maybe share your code regarding Fastify listen.. I suspect you didn't set a fallback value for your port. Are you maybe using some PORT environment variable?

@Orel-A
Copy link

Orel-A commented Mar 26, 2024

const portNumber = Number(process.env.PORT || 3000);
fastify.listen({ ...(isNaN(portNumber) ? { path: process.env.PORT } : { port: portNumber }), host: '127.0.0.1' });

Try this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants