Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ class WebUtils {
public static generateResponse(statusCode: number, message: string) {
return {
'statusCode': statusCode,
headers: {
"Access-Control-Allow-Origin" : "*", // Required for CORS support to work
"Access-Control-Allow-Credentials" : true // Required for cookies, authorization headers with HTTPS
},
body: JSON.stringify({
'result': message
})
Expand Down
2 changes: 2 additions & 0 deletions serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ functions:
- http:
path: ${self:service}/${self:custom.entity}
method: post
cors: true

put:
handler: handler.put
Expand All @@ -63,6 +64,7 @@ functions:
- http:
path: ${self:service}/${self:custom.entity}/{${self:custom.identityKey}}
method: put
cors: true

plugins:
- serverless-plugin-typescript