{"id":20565811,"url":"https://github.com/spudmashmedia/spudmash-hack-randomuser-aws-lambda","last_synced_at":"2026-06-05T19:31:17.998Z","repository":{"id":90661689,"uuid":"86153677","full_name":"spudmashmedia/spudmash-hack-randomuser-aws-lambda","owner":"spudmashmedia","description":"A sample Lambda function designed for API Gateway to proxy Randomuser.me","archived":false,"fork":false,"pushed_at":"2017-03-25T12:01:11.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-06T08:57:18.019Z","etag":null,"topics":["api","api-gateway","excercise","javascript","lambda","rest"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spudmashmedia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-25T11:51:07.000Z","updated_at":"2023-03-05T04:24:18.000Z","dependencies_parsed_at":"2023-07-09T03:45:47.872Z","dependency_job_id":null,"html_url":"https://github.com/spudmashmedia/spudmash-hack-randomuser-aws-lambda","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/spudmashmedia/spudmash-hack-randomuser-aws-lambda","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spudmashmedia%2Fspudmash-hack-randomuser-aws-lambda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spudmashmedia%2Fspudmash-hack-randomuser-aws-lambda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spudmashmedia%2Fspudmash-hack-randomuser-aws-lambda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spudmashmedia%2Fspudmash-hack-randomuser-aws-lambda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spudmashmedia","download_url":"https://codeload.github.com/spudmashmedia/spudmash-hack-randomuser-aws-lambda/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spudmashmedia%2Fspudmash-hack-randomuser-aws-lambda/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33957497,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-05T02:00:06.157Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","api-gateway","excercise","javascript","lambda","rest"],"created_at":"2024-11-16T04:39:11.933Z","updated_at":"2026-06-05T19:31:17.976Z","avatar_url":"https://github.com/spudmashmedia.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AWS Lambda function for API Gateway \nA sample Lambda function designed for API Gateway\n\n## Requirements\n\n- Nodejs 6.10  (TIP: use NVM to manage your node environment)\n- node_modules:\n    - request\n    - request-promise\n\n## Installation\n\n1) run **build.sh***\n\n```\n\u003e sh build.sh\n```\n\n3) in AWS Lambda console, create a new lambda, ignore the blueprint, instead of writing code in textbox, select upload zip, upload fn-my-lambda.zip. continue with the wizard steps.\n\n\n## Notes\n### AWS Lambda | Configuration | Handler ###\n  \nThis name is derived from ```[filename].[exports.\u003cname\u003e]```\n\nFor this function:\n\n**filename:**  index.js  (we only use 'index')\n\n**exports:**   exports.handler (we only use 'handler')\n\n the string value finally added to AWS Lambda configuration Handler text box is: **\"index.handler\"**\n  \n### How to create Test ###\n  \nTo mimick the API Gateway body payload, make sure in API Gateway | your method |Integration Request | Body Mapping Template | Content-Type |set to'application/json' + Generate tempate: Method Request Passthrough\n\nResult of this is the ability to access the query strings values, headers etc...in JSON object format\n  \nNote: if you fire off a test from API Gateway test harness, you can see the Request Body payload (input for the Lambda)\n  \ne.g. IF the API method had a question string of count=10, you can access \"count\" in the Lambda by ```event.params.querystring.count```  (will return '10')\n   \n\n### Off topic: AWS Gateway, Custom Domain Name ###\n\nTo mask the auto gen API Gateway hostname with a custom one like 'api.myhostname.com',\ngoto: API Gateway | Custom Domain Names| Create Custom Domain Name.\n\nThe gotcha here is, you need to create a ACM Certificate in North Virginia (us-east-1) -\u003e which also means your API needs to reside in North Virginia.\nHowever once setup, your API can point to Lambdas in ANY region.\n\nOnce you press create, it will take \u003e 1hour (although it says 40mins, it took 1-2hours) to create as it is creating a Cloudfront service and replicating across the CDN.\n\nonce completed, copy the **Distributed Domain Name** and head over to Route53 to create an A record with an alias to distributed domain name.\nOnce set, api should be accessible via 'api.myhostname.com'\n\nAlso note, access can still be achieved via:\n- distributed domain name\n- api gateway generated name\n\nso make sure each route utilises a Usage Plan + accessed by an API Key (trivial setup).\n\n### Off topic : AWS API Gateway, making modifications ###\nwhen ever you tweak something in the API, make sure you redeploy to appropriate staging environment. Changes do not automatically replicate!!!\n\n- especially important if you've just turned on \"Use API Key\" for a method - endpoints will remain unprotected until you redeploy!!!!!!!!\n\n\n### Off topic: AWS API Gateway Usage Plan Quota throttling\n\n- To reset a Usage Plan when calls exceed limit, goto Usage Plan | API Keys | choose key | Click Exension | grant extension by number\n\nOr Hard Reset:\n\n```Edit | disable Quota | renable Quota | Save```\n\n\n## Contributing\n1. Fork it!\n2. Create your feature branch: `git checkout -b my-new-feature`\n3. Commit your changes: `git commit -am 'Add some feature'`\n4. Push to the branch: `git push origin my-new-feature`\n5. Submit a pull request :D\n\n## History\n- V1\n\n\n\n## License\nCopyright @ 2017 Spudmash Media Pty Ltd","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspudmashmedia%2Fspudmash-hack-randomuser-aws-lambda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspudmashmedia%2Fspudmash-hack-randomuser-aws-lambda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspudmashmedia%2Fspudmash-hack-randomuser-aws-lambda/lists"}