Question

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

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.


Submit an answer


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!

Sign In or Sign Up to Answer

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.

Bobby Iliev
Site Moderator
Site Moderator badge
July 15, 2022

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

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up