URL shortener service using Tornado and Redis runs on Docker and Kubernetes.
Deploy this app to Linode with a free $100 credit!
======== ReducePy ========
.. image:: https://github.com/abdullahselek/ReducePy/workflows/ReducePy%20CI/badge.svg :target: https://github.com/abdullahselek/ReducePy/actions
.. image:: https://codecov.io/gh/abdullahselek/ReducePy/branch/master/graph/badge.svg :target: https://codecov.io/gh/abdullahselek/ReducePy :alt: Codecov
============ Introduction ============
Url shortener service using Tornado
and Redis
runs on Docker
and Kubernetes
.
================ Getting the code ================
The code is hosted at https://github.com/abdullahselek/ReducePy
Check out the latest development version anonymously with::
$ git clone git://github.com/abdullahselek/ReducePy.git
$ cd ReducePy
To install dependencies, run either::
$ pip install -Ur requirements.testing.txt
$ pip install -Ur requirements.txt
To install the minimal dependencies for production use run::
$ pip install -Ur requirements.txt
======================== Downloading Docker Image ========================
You can download docker image with::
docker pull abdullahselek/reducepy
and the docker page for the image https://hub.docker.com/r/abdullahselek/reducepy/.
============= Running Tests =============
The test suite can be run against a single Python version which requires pip install pytest
and optionally pip install pytest-cov
(these are included if you have installed dependencies from requirements.testing.txt
)
To run the unit tests with a single Python version::
$ py.test -v
to also run code coverage::
$ py.test -v --cov-report xml --cov=reducepy
To run the unit tests against a set of Python versions::
$ tox
======== Commands ========
Running up in Docker
.. code::
docker-compose up
Running in Kubernetes
.. code::
# Use Docker for minikube
eval $(minikube docker-env)
# Create developments and pods
kubectl create -f deployment-redis.yml
kubectl create -f deployment-reducepy.yml
# Create services
kubectl create -f service-redis.yml
kubectl create -f service-reducepy.yml
# Get url for **reducepy**
minikube service reducepy --url
.. code::
# Shorten url with POST
curl -i http://127.0.0.1 -F "url=https://github.com"
# Response
{
"error": false,
"shortened_url": "http://127.0.0.1/YjUwYQ"
}
# Redirect to original url
http://127.0.0.1/YjUwYQ
# Error case with invalid url
curl -i http://127.0.0.1 -F "url=github"
# Response
{
"error": true,
"message": "Please post a valid url"
}
# Error case with null url
curl -i http://127.0.0.1 -F "url="
# Response
{
"error": true,
"message": "Please post a url"
}
Please login to review this project.
No reviews for this project yet.
A Go based URL shortener, pastebin and file uploader.
URL shortener with REST API and command line interface. Inc…
Lightweight URL shortener.
Comments (0)
Please login to join the discussion on this project.