pastr is a minimal URL shortener and paste tool that has a dead-simple convention for using it
- Python 3.5+
- Install python-dotenv.
- Create your own virtualenv and activate it.
- Install the requirements:
pip install -r requirements.txt
- Create a
.envfile in root path and add the following lines to it:
Note: All responses are in
- Using GET request or just the browser (note the
- Using POST request:
curl -d "Hello, World" -X POST https://example.com
curl -d "http://mysite.com" -X POST https://example.com
In response, you will see something like the following; which is your shortened URL:
If you used a URL as the content, then by opening the shortened link you will be redirected to the original URL; otherwise it will be displayed as plain text.
A demo is available at pastr.xyz