By CodingWisely
Based on your video on how to deploy react app with laravel as API, tried to do the same with a Nuxt app. Added a env variables, absolutely everything 1:1 as is in video except for variable name for react (REACT_API…), so i got API_BASE_URL=${APP_URL}/app/api
No matter what i set into this variable, my nuxt app is trying to hit example.com/api/landing NO ‘/app/’ part. If i try to access to example.com/app/api/landing this does work.
Why is variable not taken in count?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hey there!
It looks like you are trying to set routes using env variables. Have you configured any routes in the UI for each component? It does look like this is defaulted to /api. You may also need to configure routes there for your react app if you haven’t done so.
Hope it helps! Nate
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.