This is a simple URL shortener service built using FastAPI and AWS Lambda.
To use this service, you need to have the following:
- Python 3.12 or higher
- OpenTFU installed and configured with your credentials
Once you have these prerequisites, you can deploy the service by running the following command:
tofu init
tofu apply
This will create a new AWS Lambda function that handles the URL shortening logic. The API Gateway will be used to expose this function and make it accessible over the internet.
To use this service, you can send a GET request to the following endpoint:
curl -G --data-urlencode "url=<LONG_URL>" <API_URL>/service/link/shorten
This will return a shortened version of the long URL that can be used to access the original URL.
{
"short_url": "<SHORT_URL_VERSION>",
"long_url": "<LONG_URL>"
}
Or go to
<API_URL>/service/link/docs