MicroURL takes a long URL and returns a micro URL for you
- Go 1.21+
- Terraform
- Docker (for local testing)
- AWS CLI (for AWS deployment)
- Make or PowerShell
# Build Lambda functions (Unix/Linux/WSL with zip)
make build-lambdas
# OR for Windows PowerShell users
make build-lambdas-powershell# Start LocalStack and deploy
make deploy-local
# Frontend available at: http://localhost:8080# Configure AWS credentials
aws configure
# Deploy to AWS
make deploy-lab# Download and source your Lab credentials
source ~/.aws/labsuser.sh # or paste credentials into ~/.aws/credentials
# Or configure manually
aws configure
aws configure set aws_session_token <YOUR-SESSION-TOKEN>
# Deploy using existing LabRole
make deploy-labAfter local deployment, get your API Gateway ID from Terraform output, or manually retrieve it:
cd terraform && terraform output api_gateway_idTest LocalStack endpoints:
# Create short URL (replace <api-id> with your actual ID)
curl -X POST http://localhost:4566/restapis/<api-id>/local/_user_request_/urls \
-H "Content-Type: application/json" \
-d '{"url": "https://google.com"}'
# Test redirect (use returned code)
curl -L http://localhost:4566/restapis/<api-id>/local/_user_request_/urls/<code>
# Or directly visit
http://localhost:4566/restapis/<api-id>/local/_user_request_/urls/<code>After AWS deployment, get your API Gateway ID from Terraform output, or manually retrieve it:
cd terraform && terraform output api_gateway_idTest AWS endpoints:
# Create short URL (replace <api-id> with your actual ID)
curl -X POST https://<api-id>.execute-api.us-west-2.amazonaws.com/dev/urls \
-H "Content-Type: application/json" \
-d '{"url": "https://google.com"}'
# Test redirect (use returned code)
curl -L https://<api-id>.execute-api.us-west-2.amazonaws.com/dev/urls/<code>
# Or directly visit
https://<api-id>.execute-api.us-west-2.amazonaws.com/dev/urls/<code>- Users can post a long url and get a short url.
- Visiting the short url should redirect user to the long url.
- The short url is unique for every long url provided.
- (Optional) Users can set a expiration date for the link.
- (Optional) Users can use custom alias instead if it does not already exist.
- User should receive the short url in 10 seconds.
- The short url should be avaialble in 1 minute.
- The service should support 30,000 DAU activities.
