Skip to content

Commit

Permalink
Simple subscription function example
Browse files Browse the repository at this point in the history
  • Loading branch information
mudrila committed Jan 24, 2022
1 parent 68e29ef commit e64dc25
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ yarn-error.log*
package-lock.json

#Eslint
.eslintcache
.eslintcache

.netlify
12 changes: 12 additions & 0 deletions netlify/functions/subscription.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import {Handler} from "@netlify/functions"

export const handler: Handler = async event => {
const {name = "stranger"} = event.queryStringParameters

return {
statusCode: 200,
body: JSON.stringify({
message: `Hello, ${name}!`
})
}
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@netlify/functions": "^0.11.0",
"fetch-jsonp": "^1.2.1",
"query-string": "^7.1.0",
"react": "^17.0.2",
Expand Down Expand Up @@ -37,7 +38,7 @@
},
"devDependencies": {
"@trivago/prettier-plugin-sort-imports": "^3.1.1",
"@types/node": "^17.0.8",
"@types/node": "^14.18.9",
"@types/react": "^17.0.38",
"@types/react-dom": "^17.0.11",
"eslint-config-prettier": "^8.3.0",
Expand All @@ -52,6 +53,6 @@
"prettier": "^2.5.1",
"stylelint": "^13.13.1",
"stylelint-config-standard": "^22.0.0",
"typescript": "^4.5.4"
"typescript": "^4.5.5"
}
}

0 comments on commit e64dc25

Please sign in to comment.