This service can generate the shortened url for a supplied long-url and can return long-url for the supplied shortened url.
- This service utilizes an external service called Bitly
- Bitly is used to shorten an url or look up a short-url and find the long-url.
- This API service is built using:
- Python3
- Flask
- PyShorteners
This service uses pipenv
to install dependencies. Below are the instructions:
# Clone the repo
git clone [email protected]:gitstercode/url-shortener.git
cd url-shortener
# Install dependencies
pipenv install
pipenv shell
# Run the service
python3 shoretner.py
Note: If pipenv doesn't exist, then install it with pip
thats compiled with python3
pip3 install pipenv
-
/shortify
- Takes the long-url and returns the short-urlcurl -X GET http://localhost:<port>/shortify?url=<long url>
-
/longify
- Takes the short-url and returns the original long-urlcurl -X GET http://localhost:<port>/longify?url=<shortened url>
-
/
- Returns the site-mapcurl -X GET http://localhost:<port>/
Pipfile
- Dependencies listedPipfile.lock
- Auto-Generated by pipenvshortener.py
- Application entrypoint