A simple URL shortner built in Go.
-
Run Redis
docker run --name some-redis -p 6379:6379 -d redis redis-server --save 60 1 --loglevel warning
-
Run the server
go run main.go
Sample request body -
{
"original_url": "http://www.google.com",
"url_params": [
{
"source_param": "x",
"target_param": "y",
"is_mandatory": true
}
],
"header_params": [
{
"source_param": "x",
"target_param": "y",
"is_mandatory": true
}
],
"auto_gen_params": [
{
"type": "uuid",
"target_key": "uid"
}
]
}
Redirects to the original URL
- Add tests
- Document APIs better