1

Here we made a simple website using cloud storage and a cloud run as an API . have used manage custom domain for domain mapping . When connected using javascript ,we run into CORS error .

Is there any possibility to map both with cloud storage and the cloud run API as the same domain using cloud DNS perhaps ?

So, the DNS records currently are:

example.com CNAME c.storage.googleapis.com.

we want :

example.com/service pointing to the cloud run custom domain.

I tried with URI redirect but it won't help as again we are getting CORS error.

Thanks

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
Kaustubh
  • 79
  • 1
  • 7
  • Soon, you will be able to put a loadbalancer in front of these 2 resources, and thus having only 1 IP/DNS name for all. Stay tuned. – guillaume blaquiere May 12 '20 at 13:46
  • @guillaumeblaquiere Alright ! For the time being can you suggest any method which could solve this issue ,for the time being or by using 3rd pary DNS like cloudflare ? – Kaustubh May 12 '20 at 14:13
  • @Kaustubh, Technically it's impossible to have different DNS records based on the URL –that's just not how DNS works, DNS doesn't know anything about URLs or HTTP. :) – ahmet alp balkan May 12 '20 at 16:46
  • For the time being, you could configure CORS in your Cloud Run API to accept requests from your domain example.com – Jose V May 13 '20 at 09:08
  • @JoseV exactly done , now it's working but I have used this middleware https://pypi.org/project/Flask-Cors/ ,the google docs with recommends to add header was not working as expected. – Kaustubh May 13 '20 at 17:05

0 Answers0