Repository files navigation URL Shortener (In-Memory)
git clone git@github.com:reneroboter/urlshortener.git
cd urlshortener
docker build --tag urlshortener .
docker run --publish 8888:8888 urlshortener
go build -v ./...
go test -v ./...
Happy path: Request URL from app
Happy path: Post URL to app
Parameters
code: 8ece61d2d42e578e86d9f95ad063cf36eb8e774d (string, required)
Response 301 (text/html)
Response 400 (text/plain)
Response 404 (text/plain)
curl -i http://localhost:8888/8ece61d2d42e578e86d9f95ad063cf36eb8e774d
curl -i http://localhost:8888/asd
Request (application/json)
Body: { "url": "http://www.google.de" }
Response 201 (application/json)
Response 400 (text/plain)
Response 400 (text/plain)
Body: json decoding error
Response 409 (text/plain)
curl -i -X POST http://localhost:8888/shorten \
-H " Content-Type: application/json" \
-d ' {"url":"http://www.google.de"}'
curl -i -X POST http://localhost:8888/shorten \
-H " Content-Type: application/json" \
-d ' {"url":"www.google.de"}'
About
Simple URL shortener in golang to learn the language :)
Resources
Stars
Watchers
Forks
You can’t perform that action at this time.