Skip to content

SamuelPavlik/url-shortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

URL Shortener

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/).

API Reference

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.

How to run locally

  1. Add execute permissions to the bash file.
chmod +x ./scripts/create-dynamodb-table.sh
  1. Run docker environment with DynamoDB image.
docker compose -f docker-compose.yml up -d
  1. Create a DynamoDB table.
./scripts/create-dynamodb-table.sh
  1. Run application.
mvn spring-boot:run

How to use locally

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.


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published