Can use you flask_cors in Google Cloud Functions?
app = Flask(__name__)
cors = CORS(app)
Locally this flask_cors package works but when deployed onto Cloud Functions it does not.
I have tried many different ways, as GCP has suggested https://cloud.google.com/functions/docs/writing/http but I am still getting that CORS error:
Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
No, the
appvariable is not available in Cloud Functions.Instead you can manually handle CORS:
See https://cloud.google.com/functions/docs/writing/http#handling_cors_requests for more details.