However, I created a successor of this software that is up to date and has many more features.
Please visit https://github.com/fabiancdng/Shortinator.
Rename config.template.py
to config.py
and specify your settings in that file.
You can run the app.py using python3 app.py
or python app.py
for development or testing purposes.
Keep in mind that doing so is not a proper way of deploying it for production use.
Although a Flask app comes with a built-in development server, you shouldn't use that in production.
A proper way to deploy a Flask app would, for instance, be Apache and mod_wsgi or standalone WSGI containers like Gunicorn or Gevent.
The entrypoint of this app is app.py
.
Shortlink-System provides a REST API that you can use for creating shortlinks or looking up what's behind a shortlink.
You have to provide a valid JSON body in your request.
Example:
{
"longlink": "https://github.com/fabiancdng",
"delay": "0"
}
This endpoint returns the unique part of a shortlink as plain text.
Example:
1d03
Replace SHORTLINK
in the URL with the unique part of the shortlink you'd like to look up.
This request doesn't need a body.
The response looks like this (using the example above):
{
"created": "Mon, 26 Jul 2021 18:21:15 GMT",
"delay": 0,
"id": 3,
"redirect": "https://github.com/fabiancdng",
"short": "1d03"
}
Copyright (c) 2021 Fabian Reinders