fix: enable cors

This commit is contained in:
MTG2000
2022-03-26 22:46:11 +03:00
parent fe9bdef261
commit 501ce08f05
2 changed files with 30 additions and 1 deletions

View File

@@ -1,3 +1,8 @@
[build]
functions = "functions" # netlify-lambda builds to this folder AND Netlify reads functions from here
publish = "build" # create-react-app builds to this folder, Netlify should serve all these files statically
publish = "build" # create-react-app builds to this folder, Netlify should serve all these files statically
[dev]
framework = "#static"
functions = "functions" # netlify-lambda builds to this folder AND Netlify reads functions from here
publish = "build" # create-react-app builds to this folder, Netlify should serve all these files statically

24
serverless.yml Normal file
View File

@@ -0,0 +1,24 @@
custom:
serverless-offline:
httpPort: 8888
corsAllowHeaders: "*"
plugins:
- serverless-offline
service: serverless-graphql
provider:
name: aws
runtime: nodejs12.x
functions:
graphql:
handler: functions/graphql/index.handler
events:
- http:
path: graphql
method: post
cors: true
- http:
path: graphql
method: get
cors: true