Skip to main content

URL shortening service to be used in a microservices environment.

Project description

# tinyurls

URL shortening service to be used in a microservices environment.

This service does the following:
1. Takes a long url and stores an md5 key and the url in a database table.
The md5 key is used to lookup the long url. This step returns a short link
with md5.
2. Takes a short link and redirects you to the long link.





## Installation
Clone code
```bash
git clone git@github.com:rangertaha/tinyurls.git
```
Use virtual environment
```bash
virtualenv env
source env/bin/activate

```
Change into tinyurls directory and install
```
cd tinyurls
python setup.py install

or

pip install tinyurls

```

## Execute
```bash
tinyurls -h
usage: tinyurls [-h] [-p PORT] [-d DATABASE]

optional arguments:
-h, --help show this help message and exit
-p PORT, --port PORT Port used for this service
-d DATABASE, --database DATABASE Database to use


tinyurls -p 9999

```

In a new terminal post the link to shorten
```bash
curl -X POST -H "Content-Type: text/plain" --data "https://www.google.com/search?q=tornado+logging+to+ELK&rlz=1C5CHFA_enUS752US752&oq=tornado+logging+to+ELK&aqs=chrome..69i57.9210j1j4&sourceid=chrome&ie=UTF-8" http://127.0.0.1:9999
http://127.0.0.1:9999/284380fea5eaf2464e06a3873647d324
```

In the browser go to `http://127.0.0.1:9999/284380fea5eaf2464e06a3873647d324`



Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tinyurls-0.0.3-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file tinyurls-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: tinyurls-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.4

File hashes

Hashes for tinyurls-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 30bbf2e9d43222bfb6559b3e5bc93c6f6d9bb11e3f7d200fcf1a937d3841c7fe
MD5 58f6425a38f1d60319c9ef80c0863993
BLAKE2b-256 7a4e4700df096214e107df02dfc63887c620032e860e8a4a26795f391c1b1250

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page