This is demo projcet for yhttp.
First you need to clone the project or download it directly.
git clone https://github.com/yhttp/urlshortener-example
cd urlshortener-example
pip install .
Or
pip install git+https://github.com/yhttp/urlshortener-example
You can use gunicorn to serve our wsgi application.
pip install gunicorn
you can deploy the generator
using the following command.
Note: You can bind it to any address of your liking.
cd path/to/urlshortener-example
gunicorn shortener:app --bind localhost:8000
To use urlshortener-example
use the following command to send a your URL to the app.
curl localhost:8000 -X POST -d "url=[some long URL]"
Now take the accquired short URL to make a request to get redirected.
You can use a web browser for this part as it's a simple GET request.
so simply visit localhost:8000/[short URL]
.
Now you must be automatically redirected to your original URL.
Install the necessary packages to contribute or run tests.
pip install -r requirements-dev.txt
We use bddrest to test our project.
Pull requests are welcome. Please make sure to update tests as appropriate if you decide to make a pull request.