https://github.com/peakwinter/lnkr
A simple Flask-powered link shortener
https://github.com/peakwinter/lnkr
Last synced: 7 months ago
JSON representation
A simple Flask-powered link shortener
- Host: GitHub
- URL: https://github.com/peakwinter/lnkr
- Owner: peakwinter
- License: mit
- Created: 2016-03-19T01:50:47.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-03-19T02:23:22.000Z (over 10 years ago)
- Last Synced: 2024-12-29T15:28:15.307Z (over 1 year ago)
- Language: Python
- Size: 4.88 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# lnkr
A no-frills short link creator. Built with Python (Flask).
### Getting Started
System Requirements: Python, virtualenv, SQLite3. Required Python modules are installed during the steps below.
1. Clone this repo: `git clone https://github.com/peakwinter/lnkr`
2. Create a virtualenv: `cd lnkr; virtualenv venv`
3. Enter the virtualenv: `source venv/bin/activate`
4. Install and link required modules: `pip install -r requirements.txt`
5. Run the server: `lnkr run`
### Methods
* Follow a shortlink: **GET** `/go/{id}`
* Get info on all registered shortlinks: **GET** `/links`
* Get info on a particular shortlink: **GET** `/links/{id}`
* returns a JSON shortlink object, with `id`, `url` and `created` (timestamp)
* Create a shortlink: **POST** `/links`
* Send `{"shortlink": {"url": "http://mydomain.com"}}` as JSON; returns the JSON shortlink object it just created.
* Delete a shortlink: **DELETE** `/links/{id}`
You can also create a shortened link via the command line: `lnkr add $URL`.