Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidWells committed Jun 24, 2019
2 parents d66accb + 1f07f09 commit c4620dc
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ The client server is configured to proxy `/.netlify` requests to the Lambda serv
| **[Fetch Rasperry Pi Url](https://github.com/ZachGawlik/zachgawlik.com/blob/6ae0b7485b8aeba9f440b752d35ca4207153dca1/lambdas/get-pi-url.js)** <br/> Fetch Rasperry pi URL from dataplicity | [ZachGawlik](http://github.com/ZachGawlik) |
| **[Fetch Crypto Currency Prices](https://github.com/iamronsuez/weekend-code/blob/83ccf96dd2506726c329b55188552bb25eae1831/src/functions/price.js)** <br/> Get current bitcoin prices from localbitcoins.com | [iamronsuez](http://github.com/iamronsuez) |
| **[Fetch Currency Rates](https://github.com/dlebech/off-the-books/blob/5c38c42336ccc6a75bfb69ac305fa5e36be71f36/src/lambda/currencies.js)** <br/> Fetch currency rates from eurofxref | [dlebech](http://github.com/dlebech) |
| **[Fetch Currency Rates](https://github.com/dlebech/off-the-books/blob/5c38c42336ccc6a75bfb69ac305fa5e36be71f36/src/lambda/currencies.js)** <br/> Fetch currency rates from eurofxref | [dlebech](http://github.com/dlebech) |
| **[Fetch Github Repos Graphql](https://github.com/kiranbhalerao123/itsmine.ml/blob/3b02341a6ad7d68e040c794a4d8284b344c01c33/src/netlify_lambda/getrepos.js)** <br/> get github repos from graphql endpoint | [kiranbhalerao123](http://github.com/kiranbhalerao123) |
| **[Github Finder](https://github.com/shayant98/GFServerless)** <br/> Serverless Implementation of GitHub Finder | [shayant98](http://github.com/shayant98) |
| **[Mailchimp Signup Flow](https://github.com/smkkstudios/pairity/blob/b366ec13c54f4782e16f79c18d1795e10c574102/functions/signUp.js)** <br/> Netlify functions + subscribe users to mailchimp | [smkkstudios](http://github.com/smkkstudios) |
Expand All @@ -90,6 +89,7 @@ The client server is configured to proxy `/.netlify` requests to the Lambda serv
| **[Slack Channel Invites](https://github.com/kylemcd/marketers-chat/blob/1a2689e89bfa0277a2ae459a864751e196e73af5/src/lambda/slackSubmit.js)** <br/> Send slack channel invites | [kylemcd](http://github.com/kylemcd) |
| **[Verify Phone Numbers](https://github.com/p8952/SafetyCall/blob/1da9967d4c7fb8112fca67b91f69cac8747a265f/src/functions/verifyNumber.js)** <br/> Verify phone numbers with Authy SMS | [p8952](http://github.com/p8952) |
| **[Airtable Netlify Short Urls](https://github.com/kentcdodds/airtable-netlify-short-urls/blob/dbaef3c4ddd968c5a7a823e7a71552cb5f3a3c07/functions/redirect.js)** <br/> This is a simple short-url service that works with netlify functions and uses airtable. | [kentcdodds](http://github.com/kentcdodds) |
| **[Braintree Payments](https://github.com/nadirbad/netlify-functions-example)** <br/> An implementation of Braintree payments processing [view the project](https://nadirbad.dev/posts/serverless-payments-with-braintree-and-netlify-functions/) | [nadirbad](http://github.com/nadirbad) |
| **[Bus Schedule Tracker](https://github.com/edumentab/my-next-bus/blob/master/src/functions/departures.js)** <br/> Tracking bus schedules | [edumentab](http://github.com/edumentab) |
| **[Contentful Authless Comments](https://github.com/shaunpersad/authless-comments-example)** <br/> Contentful authless comments | [shaunpersad](http://github.com/shaunpersad) |
| **[Contentful Image Saver](https://github.com/mirshko/contentful-lambda/blob/master/src/lambda/createImageEntry.js)** <br/> Save images to contentful | [mirshko](http://github.com/mirshko) |
Expand All @@ -108,13 +108,13 @@ The client server is configured to proxy `/.netlify` requests to the Lambda serv
| **[Intercom As Oauth Login](https://github.com/DavidWells/intercom-netlify-oauth)** <br/> Oauth via intercom | [DavidWells](http://github.com/DavidWells) |
| **[Lookup Dns](https://github.com/HJGreen/who-owns/blob/master/lambda-src/dns.js)** <br/> DNS lookup of a site | [HJGreen](http://github.com/HJGreen) |
| **[Mailchimp Landing Page](https://github.com/tobilg/netlify-functions-landingpage/blob/169de175d04b165b5d4801b09cb250cd9a740da5/src/lambda/signup.js)** <br/> Landing page with mailchimp | [tobilg](http://github.com/tobilg) |
| **[Mailgun](https://gist.github.com/flatlinediver/0bdca4c2ae09d34d351d45230d3b2489)** <br/> Form handler using Mailgun and Netlify Functions | [flatlinediver](http://github.com/flatlinediver) |
| **[Mongodb And Functions](https://github.com/maciejmatu/smoothielicious/tree/b7a5a76eb29af076ed228c9b5d190fb56d0df1d2/src/lambda)** <br/> Using mongoDB + functions [view the project](https://blog.elpassion.com/jam-stack-your-old-cms-into-the-closet-12cad2c7b1b3) | [maciejmatu](http://github.com/maciejmatu) |
| **[Netlify Functions Apollo Graphql](https://github.com/stubailo/apollo-netlify-lambda-app)** <br/> Deploying Apollo graphql on netlify functions [view the project](https://blog.apollographql.com/deploy-a-fullstack-apollo-app-with-netlify-45a7dfd51b0b) | [stubailo](http://github.com/stubailo) |
| **[Netlify Functions As Zips](https://github.com/DavidWells/function-zips)** <br/> Functions as zips | [DavidWells](http://github.com/DavidWells) |
| **[Netlify Functions Crud App With Fauna](https://github.com/netlify/netlify-faunadb-example)** <br/> Using faunaDB as datastore | [netlify](http://github.com/netlify) |
| **[Netlify Functions Express](https://github.com/DavidWells/netlify-functions-express)** <br/> Using express with netlify functions | [DavidWells](http://github.com/DavidWells) |
| **[Netlify Functions Gated Sites](https://github.com/DavidWells/netlify-gated-sites/tree/master/okta)** <br/> Gating multiple sites with Okta | [DavidWells](http://github.com/DavidWells) |
| **[Netlify Headless Site](https://github.com/rabbah/www/tree/56a7ce1a24df26db571719c6805242b1ff121617/src)** <br/> Serve entire site via Netlify functions + dynamic serverside HTML rendering | [rabbah](http://github.com/rabbah) |
| **[Netlify Identity Whitelist Emails](https://github.com/escaladesports/react-netlify-form/blob/7d28c95b709055a6fd4e4039248eff1a34af2fc0/src/functions/identity-signup.js)** <br/> Validate emails on Netlify identity signup | [escaladesports](http://github.com/escaladesports) |
| **[Password Protected Netlify Build Trigger](https://github.com/HeapSpace/tehnoloskidorucak/blob/d6c9bffae372aa940a0e1b117b3897408e9357f6/src/fns/build.js)** <br/> Trigger Netlify deploy with password protected function | [HeapSpace](http://github.com/HeapSpace) |
| **[Ping Superfeedr On Deploy](https://github.com/anarchivist/matienzo.org/blob/80d1a840fffa6ed9f1bd940ee4635aa4da39cd14/_functions/deploy-succeeded.js)** <br/> Ping Superfeedr RSS, Atom, or JSON feeds on successful deploy. Uses event driven functions | [anarchivist](http://github.com/anarchivist) |
Expand Down
13 changes: 12 additions & 1 deletion examples.json
Original file line number Diff line number Diff line change
Expand Up @@ -439,5 +439,16 @@
"description": "An English - Estonian dictionary",
"code": "https://github.com/azdanov/translations",
"url": "https://translations.netlify.com/"
},
{
"name": "mailgun",
"description": "Form handler using Mailgun and Netlify Functions",
"code": "https://gist.github.com/flatlinediver/0bdca4c2ae09d34d351d45230d3b2489"
},
{
"name": "braintree-payments",
"description": "An implementation of Braintree payments processing",
"code": "https://github.com/nadirbad/netlify-functions-example",
"url": "https://nadirbad.dev/posts/serverless-payments-with-braintree-and-netlify-functions/"
}
]
]
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
"markdown-magic": "^0.1.25",
"netlify-lambda": "^0.4.0",
"node-fetch": "^2.1.2",
"webpack": "^4.6.0",
"webpack-cli": "^2.0.15",
"webpack-dev-server": "^3.1.3"
"webpack": "^4.30.0",
"webpack-cli": "^3.3.0",
"webpack-dev-server": "^3.3.1"
},
"dependencies": {
"normalize.css": "^8.0.0"
Expand Down
7 changes: 3 additions & 4 deletions src/lambda/hello_fetch.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import fetch from "node-fetch";

const API_ENDPOINT =
"https://08ad1pao69.execute-api.us-east-1.amazonaws.com/dev/random_joke";
const API_ENDPOINT = "https://icanhazdadjoke.com/";

exports.handler = async (event, context) => {
return fetch(API_ENDPOINT)
return fetch(API_ENDPOINT, { headers: { "Accept": "application/json" } })
.then(response => response.json())
.then(data => ({
statusCode: 200,
body: `${data.setup} ${data.punchline} *BA DUM TSSS*`
body: data.joke
}))
.catch(error => ({ statusCode: 422, body: String(error) }));
};

0 comments on commit c4620dc

Please sign in to comment.