Service responsible for the URL shortener
create a new URL based on originalUrl
{
"full": "https://www.yoursite.com/your-path/your-page"
}
{
"status": true,
"data": {
"uuid": "0b354e7c-3d7a-4a42-94ea-135e7d20cd7d",
"short": "hRYzMtjx",
"full": "https://www.yoursite.com/your-path/your-page",
"createdAt": "2020-07-30T21:37:16.321Z",
"clicks": 0
}
}
Open the originalUrl based on code
GET http://localhost:3000/hRYzMtjx
It redirects to the originalUrl
This service is using AWS lambda with the serveless Caludia
To accomplish this you need to:
- Create an AWS profile with IAM full access, Lambda full access and API Gateway Administrator privileges.
- Add the keys to your .aws/credentials file:
[default]
aws_access_key_id = YOUR_ACCESS_KEY
aws_secret_access_key = YOUR_ACCESS_SECRET