https://github.com/otbe/serverless-url-shortener
https://github.com/otbe/serverless-url-shortener
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/otbe/serverless-url-shortener
- Owner: otbe
- Created: 2018-03-02T20:13:30.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-02T20:39:31.000Z (over 8 years ago)
- Last Synced: 2025-01-25T08:11:28.529Z (over 1 year ago)
- Language: TypeScript
- Size: 240 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# serverless-url-shortener
A starter kit for an url shortener service.
Its **serverless**, **DBless** and has a nice **GraphQL API** :)
## How it works
Empty files with a specific S3 website hosting header are used as redirect markers. A Cloudfront distribution sits in front of the S3 bucket which can be used to setup a **custom domain** (like goo.gl) for your short urls.
A small GraphQL API lets you create and list redirects.
 
## How to use
Make sure you have valid AWS credentials in your environment and then run:
`$ yarn deploy`
This will output the endpoint for your GraphQL API (something like https://\.execute-api.\.amazonaws.com/dev/graphql).
This stack deploys a Cloudfront distribution with an url like \.cloudfront.net. After you created a redirect you can use this url to test the redirection. In the example above this would be `http://.cloudfront.net/my-google`
## Gotchas
* no tracking (but you can use cloudfront logs to analyze your requests)
* no A/B testing
* no segmentation