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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swagger trying to use hardcoded port instead .env PORT value #2215

Closed
DreamShaded opened this issue Mar 3, 2024 · 0 comments
Closed

Swagger trying to use hardcoded port instead .env PORT value #2215

DreamShaded opened this issue Mar 3, 2024 · 0 comments

Comments

@DreamShaded
Copy link

DreamShaded commented Mar 3, 2024

Environment

NodeJS: 20.11.0
NitroPack: latest (2.9.1)

Clean Nitro, without Nuxt

Reproduction

  1. Create dotenv file at root dir with PORT and/or NITRO_PORT not equal 3000, for example, 3001
  2. Set experimental.openApi as true at defineNitroConfig function
  3. Write some api, for me it was greeting function returning { hello: 'world' }
  4. Start dev server
  5. Check Nitro features working on custom port
  6. Go to /_nitro/swagger
  7. Try to execute some requests

Describe the bug

I want to see results for executed request using my custom port.
I get the "failed to fetch" error, caused wrong request port.

image

Additional context

You can look at this on StackBlitz, wait for init and go to sb_url/_nitro/swagger

Logs

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants