{"id":21861727,"url":"https://github.com/alertbox/serverless-basics-device-detect-ts","last_synced_at":"2025-03-21T20:19:28.787Z","repository":{"id":148872120,"uuid":"161059905","full_name":"alertbox/serverless-basics-device-detect-ts","owner":"alertbox","description":"Shows how to use Lambda@Edge function to detect the device and redirect to respective domain.","archived":false,"fork":false,"pushed_at":"2018-12-09T18:08:45.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-26T14:54:14.642Z","etag":null,"topics":["aws-lambda","boilerplate","example-code","nodejs","serverless","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alertbox.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":"2018-12-09T16:41:11.000Z","updated_at":"2019-08-22T17:48:15.000Z","dependencies_parsed_at":"2023-07-11T13:46:26.392Z","dependency_job_id":null,"html_url":"https://github.com/alertbox/serverless-basics-device-detect-ts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alertbox%2Fserverless-basics-device-detect-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alertbox%2Fserverless-basics-device-detect-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alertbox%2Fserverless-basics-device-detect-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alertbox%2Fserverless-basics-device-detect-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alertbox","download_url":"https://codeload.github.com/alertbox/serverless-basics-device-detect-ts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244860650,"owners_count":20522471,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["aws-lambda","boilerplate","example-code","nodejs","serverless","typescript"],"created_at":"2024-11-28T03:12:29.615Z","updated_at":"2025-03-21T20:19:28.759Z","avatar_url":"https://github.com/alertbox.png","language":"TypeScript","readme":"# Overview\n\nServerless Node.js examples using TypeScript are organized into groups and designed to illustrate the techniques needed to build great microservices. To use the samples clone our GitHub repository using Git.\n\n## Build and Run from Source\n\n1. Checkout the code and install dependencies\n```shell\nsls create --template-url https://github.com/alertbox/serverless-basics-device-detect-ts --path my-basics-device-detect-svc\n```\n2. Compile and run example\n```shell\ncd my-basics-device-detect-svc\nnpm start\n```\n3. [Play with the serverless]() example\n\n## Packagin and Deploying\n\nWe use [Lambda@Edge functions](https://docs.aws.amazon.com/lambda/latest/dg/lambda-edge.html) to change CloudFront requests and responses before it forwards to the origin. Please see [Adding CloudFront Triggers](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-edge-add-triggers-cf-console.html) page on AWS for a comprehensive documentation about Customizing CloudFront using Lambda@Edge functions.\n\nWith VS Code:\n\n1. Open VS Code Terminal\n2. Build and deploy\n```shell\nnpm run build\nnpm run deploy\n```\n\nWith AWS Console:\n\n3. Login to AWS Console and go to CloudFront Console\n4. Go to the Edit Behavior pattern of your CloudFront Distribution\n5. Whitelist `CloudFront-Is-Mobile-Viewer` and `Origin` headers\n6. Associate lambda function `basics-device-detect` ARN as the `Origin Request` event type","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falertbox%2Fserverless-basics-device-detect-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falertbox%2Fserverless-basics-device-detect-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falertbox%2Fserverless-basics-device-detect-ts/lists"}