Simple Shortlink service
Simple Shortlink service
Find Source Code and deploy instruction here
A free solution for building your own shortlink service.
Usage
- Install Deta CLI and login.
- Run the following commands in your terminal
1
2
3
4git clone https://github.com/spihere/shortlink-py-deta
deta new -p shortlink-py-deta
cd shortlink-py-deta
deta deploy - The
deta new
command returns a json formatted string that contains the URL for your instance. - use
[your-instance-url]/link
to access a short link,[url]/new?src=[alias]&to=[target]
to create a shortlink,[url]/del?src=[alias]
to delete a shortlink.
Example
Create an alias
1 | [url]/new?src=google&target=https://www.google.com |
Accessing the alias
1 | [url]/google |
Deleting the alias
1 | [url]/del?src=google |
Demo
Due to abuse, I won't provide a Demo.
Contributing
By adding DBConnections implementation in the db folder, this
application can support other databases. You can do it by creating a new
file in db
folder and implements a class that inherits
DBCOnnection
abstract class. You can then change the
database
variable in main.py
to anything you
want.