Clarifai / lambdafai

Lambdafai is a simple framework for building and deploying REST APIs using AWS Lambda, API Gateway, DynamoDB, and S3.
MIT License
37 stars 4 forks source link

CORS #52

Closed dankantor closed 8 years ago

dankantor commented 8 years ago

There should be a way to enable CORS on the PI Gateway side.

dankantor commented 8 years ago

You can now handle CORS by setting the proper headers in the response object -

res.set('Access-Control-Allow-Origin', '*');
res.set('Access-Control-Allow-Headers', 'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token');
res.set('Access-Control-Allow-Methods', 'GET,POST,OPTIONS');
res.set('Access-Control-Max-Age', 300);