All Projects → CultureHQ → polyfill-lambda

CultureHQ / polyfill-lambda

Licence: MIT License
Generates polyfills based on user agent strings

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to polyfill-lambda

lifebot
Use Google Sheets to log your life by texting it Emojis and pulling in data from Fitbit automatically.
Stars: ✭ 15 (-81.93%)
Mutual labels:  aws-lambda
serverless-data-pipeline-sam
Serverless Data Pipeline powered by Kinesis Firehose, API Gateway, Lambda, S3, and Athena
Stars: ✭ 78 (-6.02%)
Mutual labels:  aws-lambda
lambda-cron
LambdaCron - serverless cron tool
Stars: ✭ 22 (-73.49%)
Mutual labels:  aws-lambda
lambda-facebook-oauth
An AWS Lambda function to facilitate Oauth2 social login with Facebook
Stars: ✭ 16 (-80.72%)
Mutual labels:  aws-lambda
amazon-eventbridge-cdk-audit-service-sample
Sample of a decoupled audit service using Amazon EventBridge and AWS Step Functions. Provisioned with AWS CDK.
Stars: ✭ 25 (-69.88%)
Mutual labels:  aws-lambda
airtable-backups-boilerplate
Configurable automated backups for Airtable meant to be self-hosted, powered by AWS Lambda/S3 with the Serverless framework
Stars: ✭ 29 (-65.06%)
Mutual labels:  aws-lambda
MCU-Countdown
An API for answering the question "When is the next MCU film?"
Stars: ✭ 95 (+14.46%)
Mutual labels:  aws-lambda
lando
📦 🚀 a smooth-talking smuggler of Rust HTTP functions into AWS lambda
Stars: ✭ 68 (-18.07%)
Mutual labels:  aws-lambda
symfony-messenger
Bridge to use Symfony Messenger on AWS Lambda with Bref
Stars: ✭ 48 (-42.17%)
Mutual labels:  aws-lambda
trackit
Trackit helps you understand and improve your use of AWS
Stars: ✭ 91 (+9.64%)
Mutual labels:  aws-lambda
aws-lambda-static-ip
AWS Lambda static outgoing IP address
Stars: ✭ 46 (-44.58%)
Mutual labels:  aws-lambda
terraform-aws-ec2-ami-backup
Terraform module for automatic & scheduled AMI creation
Stars: ✭ 19 (-77.11%)
Mutual labels:  aws-lambda
kotlin-graalvm-custom-aws-lambda-runtime-talk
This is the demo code for a talk on improving cold startup times for JVM-based lambdas using GraalVM and Custom AWS Lambda Runtimes.
Stars: ✭ 24 (-71.08%)
Mutual labels:  aws-lambda
aws-lambda-youtube-dl
Download YouTube (and a few other sites) videos to S3 using Lambda.
Stars: ✭ 78 (-6.02%)
Mutual labels:  aws-lambda
ruby-vips-lambda
AWS Lambda Layer for Ruby Libvips Gem
Stars: ✭ 34 (-59.04%)
Mutual labels:  aws-lambda
aws-lambda-ebs-backups
Python scripts to be run using AWS's Lambda service to Backup and Delete Snapshots of EBS Volumes
Stars: ✭ 31 (-62.65%)
Mutual labels:  aws-lambda
aws-lambda-nodejs-webpack
λ CDK Construct to build Node.js AWS lambdas using webpack
Stars: ✭ 32 (-61.45%)
Mutual labels:  aws-lambda
aws-lambda-edge-basic-auth-terraform
A Terraform module that creates AWS Lambda@Edge resources to protect CloudFront distributions with Basic Authentication.
Stars: ✭ 18 (-78.31%)
Mutual labels:  aws-lambda
serverless-company
Serverless. FaaS. Spring Boot. Spring Cloud Function
Stars: ✭ 15 (-81.93%)
Mutual labels:  aws-lambda
aws-lambda-firewall
Securely and conveniently support IP address whitelists for your publicly routable services.
Stars: ✭ 16 (-80.72%)
Mutual labels:  aws-lambda

polyfill-lambda

Build Status

polyfill-lambda is a service deployed to Amazon Web Services that returns JavaScript polyfills based on the user agent of the requesting browser. You can use this package to deploy your own version for your service or organization.

Getting started

Ensure you have node and yarn installed.

  1. Run yarn in the root of the repository to get the dependencies.
  2. Create a src/features.js file (you can copy the sample) containing the features that you want polyfilled. You can take a look at polyfill.io's docs for the available options.
  3. Create a src/headers.js file (you can copy the sample) containing the desired headers to be served alongside the JavaScript.

Now you can run yarn start to start a local server at http://localhost:8080. Visit that location in different browsers to view the polyfill. Note that since this server is running in development, it returns unminified JavaScript.

Deployment

First, copy serverless-env.yml.sample to serverless-env.yml and fill in the relevant information. Below are the explanation for the options:

  • bucket.name - any name unique to S3. Nothing actually gets stored in here, it's just used as the origin for CloudFront
  • distribution.alias - the domain that will be used for the CloudFront distribution (presumably something like polyfill.culturehq.com)
  • distribution.cert-arn - the ARN of an AWS Certificate Manager certificate that matches the alias (as in, as certificate for polyfill.culturehq.com)

With the config in place, install serverless by running npm install -g serverless. You can then run sls deploy --aws-profile [PROFILE] to deploy the lambda function, S3 bucket, and CloudFront distribution.

Once everything has been deployed, you can associate the CloudFront distribution with your domain through AWS Route53 by creating an alias record for the appropriate hosted zone. Then you can include script tag like the below to conditionally load only the correct polyfills:

<script type="text/javascript" src="https://polyfill.culturehq.com"></script>

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/CultureHQ/polyfill-lambda.

License

The code is available as open source under the terms of the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].