-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Apologies if this is an obvious or redundant question, I'm very new to Chalice and backend web in general.
I'm trying to connect my website's frontend to my Chalice REST API. My website has two subdomains: "mywebsite.com" and "www.mywebsite.com". I would like to add both of these origins to my CORSConfig for an API route. The documentation states:
You should only supply a single origin to the
CORSConfigobject. If you need to supply multiple origins you will need to define a custom handler for it that acceptsOPTIONSrequests and matches theOriginheader against a whitelist of origins. If the match is successful then return just theirOriginback to them in theAccess-Control-Allow-Originheader.
Is there some additional guidance, beyond this doc, on best practices for implementing this? I have no clue what this handler should look like.