Skip to content

A simple demo on options to add CORS headers to the GCP Cloud CDN

Notifications You must be signed in to change notification settings

milesmatthias/cloud-cdn-cors-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

cloud-cdn-cors-demo

A simple demo on options to add CORS headers to the GCP Cloud CDN

NOTE -- This is for demo purposes only. Do not run this in production. This repo will not be maintained either. It is also recommended that you run this demo in a new project.

Pre-reqs

  1. Authenticate: gcloud auth default-application login
  2. Set your project gcloud config set project <project-id>

Create infrastructure

make create

will create the necessary infrastructure for this demo. Mainly:

  1. A GCS bucket with example/index.html in it
  2. Add CORS configuration to the GCS bucket for example.appspot.com
  3. Cloud CDN distribution with the GCS bucket as the origin

See cors-config-example.json for the example CORS config.

Validate our demo

make validate

will request index.html from the Cloud CDN and ensure CORS headers are present. If not, you'll see an error message.

Resources

About

A simple demo on options to add CORS headers to the GCP Cloud CDN

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published