Skip to content

Commit

Permalink
refactor: get netlify funcs working
Browse files Browse the repository at this point in the history
  • Loading branch information
jsjoeio committed May 31, 2020
1 parent f59d4bc commit d200371
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,8 @@ public
.env.production

# firebase
service-account.json
service-account.json
serviceAccountKey.json

# netlify funcs
functions-build
1 change: 0 additions & 1 deletion functions/hello.js

This file was deleted.

8 changes: 8 additions & 0 deletions functions/page-views.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
exports.handler = async (event, context) => {
return {
statusCode: 200,
body: JSON.stringify({
data: `Test data added successfully`,
}),
}
}
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build]
functions = "functions"
functions = "functions-build"
publish = "public"

[[plugins]]
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@
"license": "MIT",
"main": "n/a",
"scripts": {
"build": "GATSBY_EXPERIMENTAL_PAGE_BUILD_ON_DATA_CHANGES=true gatsby build --log-pages && netlify-lambda build src/functions",
"build:lambda": "netlify-lambda build src/functions",
"build": "GATSBY_EXPERIMENTAL_PAGE_BUILD_ON_DATA_CHANGES=true gatsby build --log-pages && netlify-lambda build functions",
"build:lambda": "netlify-lambda build functions",
"build:local": "gatsby build",
"g:post": "hygen post new",
"dev": "gatsby develop",
"start": "run-p start:**",
"start:app": "npm run dev",
"start:lambda": "netlify-lambda serve src/functions"
"start:lambda": "netlify-lambda serve functions"
}
}
11 changes: 0 additions & 11 deletions src/functions/hello.js

This file was deleted.

0 comments on commit d200371

Please sign in to comment.