nitro
nitro copied to clipboard
Swagger trying to use hardcoded port instead .env PORT value
Environment
NodeJS: 20.11.0 NitroPack: latest (2.9.1)
Clean Nitro, without Nuxt
Reproduction
- Create dotenv file at root dir with PORT and/or NITRO_PORT not equal 3000, for example, 3001
- Set experimental.openApi as true at defineNitroConfig function
- Write some api, for me it was greeting function returning
{ hello: 'world' }
- Start dev server
- Check Nitro features working on custom port
- Go to
/_nitro/swagger
- 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.
Additional context
You can look at this on StackBlitz, wait for init and go to sb_url/_nitro/swagger
Logs
No response