A free solution for building your own shortlink service.
- Install Deta CLI and login.
- Run the following commands in your terminal
git 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.
[url]/new?src=google&target=https://www.google.com
[url]/google
[url]/del?src=google
Due to abuse, I won't provide a Demo.
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.