Report this

What is the reason for this report?

Connect a static App Platform site to an external API, URL gets rewritten

Posted on July 13, 2022

I created an App, making a static site based on Vue. However, when I set the graphql endpoint, the App seems to add on the base URL, making it incorrect, and so it doesn’t allow me to connect it to the API. Have I chosen the wrong type of App? Is there a way to avoid this rewrite?

eg https://mysite.com/graphql

gets rewritten to https://generated.digital.ocean.url/mysite.com/graphql

EDIT: It looks like the issue was that my component-level environment variable was missing the https:// and I was just looking at the app-level environment variable which was properly configured.



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!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there,

Happy to hear that you’ve got it all working by adding the environment variable and thank you for sharing this information here with the community.

Best,

Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.