2
votes

I wanted to add a http headers access control allow origin to make my app compatible with CORS. I did it in the app.yaml file but when I try to deploy my server, it make me a parsing error.

An error occurred while parsing file

Here is my app.yaml

runtime: nodejs
env: flex

skip_files:
  - ^node_modules$

handlers:
  - url: /generate
    http_headers:
      Access-Control-Allow-Origin: http:/localhost:3000

Do someone have an idea please ? I think that I have respect the indentation.

Thanks :)

1
Trying putting a - (dash) before http_headerssideshowbarker
I tried, but still doesn't working :/ In the gcp docs it's on my way I've to write itShoto Amb
You are missing a / in your url: http://localhost:3000John Hanley

1 Answers

4
votes

To avoid the parsing error you need to include the directory of the shared resources:

handlers:
- url: /generate
  static_dir: static/whatever
  http_headers:
    Access-Control-Allow-Origin: http://localhost:3000