-
Notifications
You must be signed in to change notification settings - Fork 244
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
base url is not working #134
Comments
Are you sure |
Yes sir, On the top,
|
why dont you set this env in nuxt.config.js like this:
and use just like these:
|
and what I saw you declare the param with a space。
*api location *with a space |
this is my full nuxt.config.js
and for axios plugins/axios
|
You should declare your baseURL without Personally i just directly set the baseUrl in
|
Hi Sir @SnooHD , Yes. without the brackets. I just indicate the bracket for example url. but for store
|
If you do not use arrow functions, you can access
You can find an example here: This way you do not have to use axios as a plugin. |
Hi @SnooHD, Thank you! I need some advice with this one
I set the cookie on my plugins/axios
Am i doing right? |
Why are you not using Demo: Api: Good luck :) |
in nuxt.config.js use like this.
|
@forteleaf That is the issue: the owner of the post sees that axios sends |
@begueradj got the same issue. do you have a solution for that? |
The solution I opted for was just to declared the URL variable on the page I needed. I know this is not clean, but that is the deal with Nuxt.js @fanvyr |
Just double check that the variable is named |
This comment has been minimized.
This comment has been minimized.
Why it could not automatically guess base url, like just axios doing itself? |
Well, the bug issuer did not write |
But actually, I have this problem. As a begginer in nuxt, I tried to use nuxt-axios and it does not work. I spent time looking on how to configure it if I dont have "hardcoded" host...
Make it works |
in nuxt.config.js, instead of:
use it:
|
This is AWESOME! Now what I am sure is that I am blind haha 🤣 |
None of the above works unfortunately. NuxtJS/Axios, all request stay localhost instead of using the value in baseURL. |
use |
I have a simple solution...
http://localhost:3000/api/ --> http://localhost:8080/ it is fixed for me, I tried other solutions but only this working... |
I had the same issue. The solution for me was:
This will send a request to |
Still not working until today. Can anyone share shred some light from this. This is crucial for any apps i believe? |
@darrenchiu I can share what works for me in one of our projects, if it helps: package.json:
nuxt.config.js:
and for example the below in a component makes a request to YOUR_API.COM/orders
You CAN override this though with, for example:
|
i had same issue , after 45 minutes headache and googling I get to know what I was doing wrong const instance = axios.create({ which was incorrect ........ it must be baseURL not baseUrl please check this spelling mistake thanks |
БЛяяяяяяяяяяяяяяяяя ть |
@dotsimplify : You save my life, thanks a lot!! |
Hi,
please help me
on my nuxt.config.js
and for my actions
but for the request
it request on the localhost
http://localhost:3000/verify/phone
The text was updated successfully, but these errors were encountered: