URL shortener service written in Scala, using Akka-Http and Redis.
Deploy this app to Linode with a free $100 credit!
URL shortener service
http://reduc.io/wuXaq
We could use following short code gen also:
substr(base62(md5(url)), 6) = 62 ^ 6 //unique short urls
Run docker-compose
, it will start api
, redis
and will expose api port to host.
docker-compose up
# Shorten
curl -i http://localhost:9001 -F "url=https://www.amazon.com/Star-Wars-Battlefront-II-Digital/dp/B072JZZ4XD"
# Call shortened url
for ((i=1;i<=100;i++)); do curl -i "http://localhost:9001/SEwuXHhBQw"; done
# Get Stats
curl -i "http://localhost:9001/stats/?url=https://www.amazon.com/Star-Wars-Battlefront-II-Digital/dp/B072JZZ4XD"
# returns: {"callCount":100}
sbt packageBin
sbt test
Simulation users count can be set in application.conf
in test resources.
# terminal 1
sbt run
# Run simulation in terminal 2
sbt gatling:test gatling:latestReport
sbt clean coverage test coverageReport
Redis
calls using Retry or similar onez i λ a s a l.
Please login to review this project.
No reviews for this project yet.
Comments (0)
Please login to join the discussion on this project.