baseUrl default port is :3000 even when nuxt use a random port
See original GitHub issueVersion
Reproduction link
Steps to reproduce
- Run
nuxt dev
when port 3000 is already in use - Nuxt will start on a random port
- Do not edit the axios object in nuxt.config.js
- Call to localhost will fail because they will use port 3000 instead of random nuxt port
What is expected ?
Axios should use process.env. NUXT_PORT
What is actually happening?
Axios default to port 3000
Additionnal info
I do this because I load json data hosted in the static folder. I can’t use import as these fill will be updated regularly via a setInterval
<div align="right">This bug report is available on Nuxt community (#c302)</div>Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Nuxt/Axios: baseURL with same origin, but different port ...
The problem is, when I access my frontend (for example 192.168.1.XXX:3000 ), all axios api requests are still sent to http://localhost:8800/api/ ...
Read more >Configuration - Nuxt
By default, Nuxt is configured to cover most use cases. ... You can also change the port number from the default port of...
Read more >scribe.config.js
The baseUrl key is the base URL Scribe will make requests to. Typically, this should be the URL (+ port) your app runs...
Read more >Build an API with Node.js, Express, and TypeScript - Split
Build a RESTful API using Node.js, TypeScript, and Express. ... the server will run on port 3000 , with the base URL where...
Read more >Nuxt: The Hard Parts - Jonas Galvez
api' export default { serverMiddleware, modules: ['@nuxt/http'], server: { port: 3000 }, http: { baseURL: 'http://localhost:3000' } }.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Setting
baseURL: '/'
did the trick, but it’s weird I feel like if I do not set the baseURL, it should bind to the correct portwork for me with this config