{"id":22724791,"url":"https://github.com/mridang/serverless-polyfill","last_synced_at":"2025-03-29T23:21:25.931Z","repository":{"id":41800568,"uuid":"163147731","full_name":"mridang/serverless-polyfill","owner":"mridang","description":"A serverless application built atop the Serverless framework to run the Polyfill service","archived":false,"fork":false,"pushed_at":"2023-02-28T06:10:24.000Z","size":1745,"stargazers_count":0,"open_issues_count":7,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-05T00:43:32.517Z","etag":null,"topics":["aws-lambda","polyfill-io","serverless","serverless-framework"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mridang.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}},"created_at":"2018-12-26T07:00:40.000Z","updated_at":"2018-12-26T09:23:38.000Z","dependencies_parsed_at":"2023-01-30T06:46:19.213Z","dependency_job_id":null,"html_url":"https://github.com/mridang/serverless-polyfill","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/mridang%2Fserverless-polyfill","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mridang%2Fserverless-polyfill/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mridang%2Fserverless-polyfill/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mridang%2Fserverless-polyfill/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mridang","download_url":"https://codeload.github.com/mridang/serverless-polyfill/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246255756,"owners_count":20748122,"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","polyfill-io","serverless","serverless-framework"],"created_at":"2024-12-10T15:07:56.595Z","updated_at":"2025-03-29T23:21:25.913Z","avatar_url":"https://github.com/mridang.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# serverless-polyfill\n\nUses [polyfill.io](https://polyfill.io/v2/docs/)'s service to generate a Polyfill based on the user agent of the request. Aggressively caches to ensure as few requests as possible.\n\n##### Caching\n\nAll the responses are cached for a day and varied by the `User-Agent` header. As the endpoint is the same for all browsers, the `Vary` by `User-Agent` header will ensure that cached payloads are different depending upon the browser.\n\n##### CORS\n\nCORS is enabled by default for all endpoints and allows any origin i.e. `*`\n\n## Getting started\n\nEnsure you have `node` and either `npm` or `yarn` installed globally. Serverless requires Node 8.10.0.\n\n---\n\n##### NVM\n\nIf you are using a different version of Node, we recommend using `nvm` to run different versions. Set up the correct Node environment bar running `nvm use`. This will automatically read the contained `.nvmrc` file and set the appropriate version.\n\n---\n\nRun `yarn install`to fetch all  the dependencies and once done, run `yarn serve` to start a local server at `http://localhost:3000`. \n\n## Deployment\n\nPolyfill allows deployment to AWS Lambda with a single command. Run `sls deploy --stage [STAGE]` to deploy the function. \n\n**Note:** If the `--stage` parameter is not specified, Serverless will default to `dev`.\n\n**Note:** The `NODE_ENV` variable is always forced to be `production` irrespective of whether the service is running offline or in the cloud. This is so that the Polyfill service will run in production mode. \n\nThis will trigger output that looks something like:\n\n```\nServerless: Packaging service...\nServerless: Excluding development dependencies...\nServerless: Uploading CloudFormation file to S3...\nServerless: Uploading artifacts...\nServerless: Uploading service .zip file to S3 (57.17 MB)...\nServerless: Validating template...\nServerless: Updating Stack...\nServerless: Checking Stack update progress...\n..............\nServerless: Stack update finished...\nService Information\nservice: polyfill\nstage: production\nregion: us-west-2\nstack: polyfill-production\napi keys:\n  None\nendpoints:\n  GET - https://xxxxxxxxxx.execute-api.us-west-2.amazonaws.com/production/polyfill\nfunctions:\n  polyfill: polyfill-production-polyfill\n```\n\n## Usage\n\nPlace the endpoint URL in a `script` tag in your application's HTML before you load your main JavaScript to get all of the necessary polyfills. Polyfill will use your browser's user-agent to determine all the Polyfills that should be loaded.\n\n##### HTML\n\nView the source of the included `debug.html` file to see how the Polyfill service should be used on a webpage.\n\n##### cURL\n\n```shell\ncurl -v http://localhost:3000/polyfill.js\n```\n\n## Linting\n\nThis service uses Prettier to format and lint it's sources. Run `yarn build` to prettify all the sources.\n\n## Testing\n\nServerless uses Jest for testing. Run the entire test suite by executing `yarn test`. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmridang%2Fserverless-polyfill","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmridang%2Fserverless-polyfill","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmridang%2Fserverless-polyfill/lists"}