Simple URL shortener written in Kotlin Spring. Utilizes DynamoDB for storage of the url mappings. Hosted on AWS Elastic Beanstalk (http://myurlshortener-test.eba-esgd5rws.eu-west-1.elasticbeanstalk.com/).
To generate a short code for a given url use the following command:
curl --location 'http://myurlshortener-test.eba-esgd5rws.eu-west-1.elasticbeanstalk.com/v1/shortenUrl' \
--header 'Content-Type: application/json' \
--data '{
"originalUrl": <url/to/shorten>
}'
To access the original url via the short code simply type
http://myurlshortener-test.eba-esgd5rws.eu-west-1.elasticbeanstalk.com/v1/<short-code>
into your browser.
- Add execute permissions to the bash file.
chmod +x ./scripts/create-dynamodb-table.sh
- Run docker environment with DynamoDB image.
docker compose -f docker-compose.yml up -d
- Create a DynamoDB table.
./scripts/create-dynamodb-table.sh
- Run application.
mvn spring-boot:run
To generate a short code for a given url use the following command:
curl --location 'http://localhost:8080/v1/shortenUrl' \
--header 'Content-Type: application/json' \
--data '{
"originalUrl": <url/to/shorten>
}'
To access the original url via the short code simply type http://localhost:8080/v1/<short-code>
into your browser.