This project goal is to provide users a way to share files, strings, or URL's with each other by using a token. When creating the token, specifications for the lifetime of the object can be dictated. Once an object has reached the end of its life, it will behave as though it never existed.
Run the application with python main.py
.
Send a POST to it by running something like:
➜ curl -sL localhost:3000/new -XPOST -d 'https://google.com'
bf0f75323a5684c82f6cfc80190eb6589a96f511f80fb4573fe9235ad94a0fb6%
Get a URL/String by running something like:
➜ curl localhost:3000/bf0f75323a5684c82f6cfc80190eb6589a96f511f80fb4573fe9235ad94a0fb6
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>Redirecting...</title>
<h1>Redirecting...</h1>
<p>You should be redirected automatically to target URL: <a href="https://google.com">https://google.com</a>. If not click the link.%
Similarly, if you browse to http://localhost:3000/bf0f75323a5684c82f6cfc80190eb6589a96f511f80fb4573fe9235ad94a0fb6 in your browser, you will be redirected to https://google.com, as shown above from the curl response.
You can delete a string by adding the DELETE
method to your curl, like this:
➜ curl -XDELETE localhost:3000/bf0f75323a5684c82f6cfc80190eb6589a96f511f80fb4573fe9235ad94a0fb6
token deleted, or it never existed.%
You can verify the token was deleted by attempting to hit it again
➜ curl localhost:3000/bf0f75323a5684c82f6cfc80190eb6589a96f511f80fb4573fe9235ad94a0fb6%
token deleted, or it never existed.%
Right now, this application only uses a SQLITE3 database. This should be swapped for something else before any semblance of scale can be achieved.
I'm also not sure why you'd want to scale it. This is really just a shitty proof-of-concept.