Skip to content
This repository has been archived by the owner on Aug 13, 2020. It is now read-only.

Commit

Permalink
fix: enable cors
Browse files Browse the repository at this point in the history
fix #19
  • Loading branch information
MauricioRobayo committed Dec 17, 2018
1 parent 25f4b05 commit b9b7611
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/helpers.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
const config = require("./config");

const createResponse = (statusCode, body) => ({
headers: {
"Content-Type": "application/json",
"Access-Control-Allow-Origin": "*"
},
statusCode,
body: JSON.stringify(body)
});
Expand Down
5 changes: 3 additions & 2 deletions template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ Description: JSON API para consultar la Tasa Representativa del Mercado en la Su
Globals:
Api:
Cors:
AllowMethods: "'*'"
AllowHeaders: "'*'"
AllowHeaders: "'Content-Type, Authorization, X-Amz-Date, X-Api-Key, X-Amz-Security-Token'"
AllowMethods: "'GET'"
AllowOrigin: "'*'"
MaxAge: "'600'"
Resources:
TrmTable:
Type: AWS::DynamoDB::Table
Expand Down

0 comments on commit b9b7611

Please sign in to comment.