Sign inSign up

alpert/kisalt

By alpert

Updated over 8 years ago

Simple URL shortener service backed with Redis

Image
0

296

alpert/kisalt repository overview

kisalt

kisalt (means make it short in Turkish - kısalt actually) is a basic URL shortener.

Running

If you want persistency, first create a volume and start redis with mounting it:

$ docker volume create redis
$ docker run --name redis-app -v redis:/data redis redis-server --appendonly yes

Then build docker image for kisalt and run it:

$ docker build -t kisalt .
$ docker run --name kisalt --link redis-app:redis -p 8080:8080 kisalt --spring.redis.host=redis
# You can run another as:
$ docker run --name kisalt-1 --link redis-app:redis -p 8081:8080 kisalt --spring.redis.host=redis
API

kisalt uses Basic Auth and default credentials are alpert:alpert

Shorten url

[POST] http://localhost:8080/v1/shorten
http://url-to-be-shortened-in-body

Redirect to url

[GET] http://localhost:8080/v1/:id
Redirects to corresponding original url

Info about url

[GET] http://localhost:8080/v1/info/:id

After running you can view Swagger api documentation by browsing to:

http://localhost:8080/swagger-ui.html

Tag summary

Content type

Image

Digest

Size

100.1 MB

Last updated

over 8 years ago

docker pull alpert/kisalt