diff --git a/netlify.toml b/netlify.toml index 10aed6d..c4a7c8c 100644 --- a/netlify.toml +++ b/netlify.toml @@ -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 \ No newline at end of file + 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 diff --git a/serverless.yml b/serverless.yml new file mode 100644 index 0000000..32db83f --- /dev/null +++ b/serverless.yml @@ -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