Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

README.md

Serverless Shrink

URL shortener API built with the Serverless framework.

POST a URL to https://go.vann.io:

curl -H "Content-Type: application/json" -X POST -d '{"url": "http://www.superlongridiculousurl.com"}' https://go.vann.io

Example response:

{
  "message": "Success",
  "data": {
    "url": "http://www.superlongridiculousurl.com",
    "shrink": "go.vann.io/a43f3e1ce0"
  }
}

Prerequisites


Initialise

  1. Generate user access and secret keys from IAM
  2. Run aws configure to set up AWS caller identity
  3. Check config by running aws sts get-caller-identity

Deployment

  1. Ensure stage config is set correctly in the vars directory*
  2. Comment out the CustomDomainMap block in serverless.yml*
  3. Run sls deploy --stage <stage> where stage is dev or prod, eg. --stage dev
  4. Set up API Gateway custom domain name mapping
  5. Add DNS records to point your domain to API Gateway*
  6. Restore the CustomDomainMap block in serverless.yml*
  7. Re-run sls deploy --stage <stage>*

*on initial deploy

Debugging

  • Logs can be found in CloudWatch
  • If things are unsalvageable, you can delete everything to start from scratch:
    1. Remove custom domain name mapping from API Gateway manually
    2. Run sls remove --stage <stage>

About

✂️ URL shortener API

Topics

Resources

Releases

No releases published

Packages

No packages published
You can’t perform that action at this time.