All Projects → danielireson → Serverless Url Shortener

danielireson / Serverless Url Shortener

Licence: mit
URL shortener for AWS Lambda and S3

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Serverless Url Shortener

Serverless Plugin Git Variables
⚡️ Expose git variables to serverless
Stars: ✭ 75 (-48.63%)
Mutual labels:  aws-lambda, serverless-framework
Serverless
⚡ Serverless Framework – Build web, mobile and IoT applications with serverless architectures using AWS Lambda, Azure Functions, Google CloudFunctions & more! –
Stars: ✭ 41,584 (+28382.19%)
Mutual labels:  aws-lambda, serverless-framework
Alexa Skill Serverless Starter Template
An Alexa Skill starter project template that uses the Serverless Framework and the Alexa Skills Kit SDK for Node.js
Stars: ✭ 81 (-44.52%)
Mutual labels:  aws-lambda, serverless-framework
Ng Toolkit
⭐️ Angular tool-box! Start your PWA in two steps! Add Serverless support for existing projects and much more
Stars: ✭ 1,116 (+664.38%)
Mutual labels:  aws-lambda, serverless-framework
Serverless Architectures Aws
The code repository for the Serverless Architectures on AWS book
Stars: ✭ 120 (-17.81%)
Mutual labels:  aws-lambda, serverless-framework
Serverless Node Simple Image Resize
Simple image resize AWS lambda function
Stars: ✭ 74 (-49.32%)
Mutual labels:  aws-lambda, serverless-framework
Serverless With Next5 Boilerplate
Serverless.js with Next.js 5 on AWS, powered by the Serverless Framework
Stars: ✭ 100 (-31.51%)
Mutual labels:  aws-lambda, serverless-framework
Serverless Aws Lambda Node Postgres
Serverless AWS Lambda with Node.js,Postgres Rest API with Sequelize.
Stars: ✭ 18 (-87.67%)
Mutual labels:  aws-lambda, serverless-framework
Serverless Side Rendering React Next
Sample repo for setting up Next and React on AWS Lambda with the Serverless Framework.
Stars: ✭ 117 (-19.86%)
Mutual labels:  aws-lambda, serverless-framework
Serverless Docker Image Resize
Simple serverless image resize on-the-fly - Deploy with one command - Built with AWS Lambda and S3
Stars: ✭ 114 (-21.92%)
Mutual labels:  aws-lambda, serverless-framework
Serverless Es Logs
A Serverless plugin to transport logs to ElasticSearch
Stars: ✭ 51 (-65.07%)
Mutual labels:  aws-lambda, serverless-framework
A Crash Course On Serverless Auth
A short and easy boilerplate showcasing JWT auth with Nodejs, the Serverless framework, MongoDB and AWS Lambda.
Stars: ✭ 127 (-13.01%)
Mutual labels:  aws-lambda, serverless-framework
Chalice
Python Serverless Microframework for AWS
Stars: ✭ 8,513 (+5730.82%)
Mutual labels:  aws-lambda, serverless-framework
Serverless Node Simple Messaging
Simple email AWS lambda function
Stars: ✭ 75 (-48.63%)
Mutual labels:  aws-lambda, serverless-framework
Graphql Serverless
Sample project to guide the use of GraphQL and Serverless Architecture.
Stars: ✭ 28 (-80.82%)
Mutual labels:  aws-lambda, serverless-framework
Kinesis Streams Fan Out Kinesis Analytics
Amazon Kinesis Streams fan-out via Kinesis Analytics (powered by the Serverless Framework)
Stars: ✭ 95 (-34.93%)
Mutual labels:  aws-lambda, serverless-framework
Puppeteer Lambda Starter Kit
Starter Kit for running Headless-Chrome by Puppeteer on AWS Lambda.
Stars: ✭ 563 (+285.62%)
Mutual labels:  aws-lambda, serverless-framework
Serverless Plugin Typescript
Serverless plugin for zero-config Typescript support
Stars: ✭ 611 (+318.49%)
Mutual labels:  aws-lambda, serverless-framework
Awesome Layers
λ A curated list of awesome AWS Lambda Layers. Sponsored by https://cloudash.dev
Stars: ✭ 1,655 (+1033.56%)
Mutual labels:  aws-lambda, serverless-framework
Serverless
Serverless 架构应用开发指南 - Serverless Architecture Application Development Guide with Serverless Framework.
Stars: ✭ 1,616 (+1006.85%)
Mutual labels:  aws-lambda, serverless-framework

Serverless URL Shortener

A lightweight URL shortener built with the Serverless Framework using AWS Lambda and S3. Each URL redirection is stored as an S3 object with the Website-Redirect-Location metadata key set to the forwarding web address. AWS Lambda is used to create an API to save these objects. The website is served from the same S3 bucket.

Screenshot

Setup

Install dependencies

Head on over to the Serverless Framework docs and run through their quick-start guide. It’s mentioned in there as part of your setup, but be sure to install the AWS CLI and configure your AWS credentials. Then run npm install to get the NPM dependencies for the project.

Setup Route 53

Create Route 53 hosted zones for both the API and website.

Add environment variables

Create a copy of .env.example for each "stage" that you wish to deploy to (e.g .env.staging, .env.production) and then customise each configuration file as appropriate for your setup.

Name Description Required
BUCKET S3 bucket that will store URL redirects Y
REGION AWS region to deploy to Y
API_URL API endpoint the website will interact with Y
API_DOMAIN Custom API domain the API will be served from Y
API_HOSTED_ZONE AWS Route53 hosted zone ID with the custom API domain Y
API_CERTIFICATE_NAME AWS Certificate Authority certificate name for API domain Y
API_BASE_ENDPOINT API Gateway base path (e.g. prefix) for lambda function Y
SHORT_URL Base URL of shortened links (without trailing slash) Y
SHORT_DOMAIN Custom short domain to serve the website Y
SHORT_HOSTED_ZONE AWS Route53 hosted zone ID with the custom short domain Y
SHORT_DOMAIN_ACM_ARN AWS Certificate Authority certificate name for short domain Y
TITLE Customize the title of the website and form N
CREDIT Customize the credit name in the footer N
CREDIT_URL Customize the credit link in the footer N
AWS_PROFILE AWS profile setup in ~/.aws/credentials N

Deploy API

Run npm run deploy to deploy the API and website to AWS. The resources defined in serverless.yml will be automatically instantiated using CloudFormation. Prefix with the stage you want to deploy (e.g. STAGE=production npm run deploy).

Architecture based on serverless-aws-static-websites:

Architecture

Build template

Run npm run build to build the template with appropriate template variables.

Deploy website

Run npm run deploy:client to deploy the website using the AWS CLI.

You can add a ?vanity= query string parameter to the homepage to specify a vanity (custom) shortcode instead of a randomly-generated one. If the name is already taken, a random one will be used instead.

Libraries used

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].