parent
eb9c2898d0
commit
72a51055d2
@ -0,0 +1,49 @@ |
|||||||
|
<!DOCTYPE html> |
||||||
|
<html lang="en"> |
||||||
|
<head> |
||||||
|
<title>Post-it!</title> |
||||||
|
<meta charset="utf-8"> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
<h1>Welcome to Post-it!</h1> |
||||||
|
|
||||||
|
<p>Post-it is a tiny file sharing server for small files with limited lifespan.</p> |
||||||
|
|
||||||
|
<h2>API quickstart</h2> |
||||||
|
|
||||||
|
<h3>Submit a file: POST binary body to "/"</h3> |
||||||
|
|
||||||
|
<ul> |
||||||
|
<li>Accepts <code>X-Expire</code> (secs) and <code>Content-Type</code> headers. |
||||||
|
<li>Also accepts an <code>expire</code> URL param. |
||||||
|
<li>Returns a secret token in the <code>X-Secret</code> header, and a File ID in response body. |
||||||
|
</ul> |
||||||
|
|
||||||
|
<h3>Read a file: GET /<file-id></h3> |
||||||
|
<ul> |
||||||
|
<li>The remaining lifespan us returned in an <code>X-Expire</code> header (secs). |
||||||
|
</ul> |
||||||
|
|
||||||
|
<h3>Update a file: PUT to /<file-id></h3> |
||||||
|
<ul> |
||||||
|
<li>Accepts the same headers and params as POST. |
||||||
|
<li>Body may be left empty to leave it unchanged. |
||||||
|
<li>File's lifespan can be extended by setting a new expiration time. |
||||||
|
<li>Requires the secret token as an <code>X-Secret</code> header or a <code>secret</code> URL param. |
||||||
|
</ul> |
||||||
|
|
||||||
|
<h3>Delete a file: DELETE /<file-id></h3> |
||||||
|
<ul> |
||||||
|
<li>The secret token is required, like with PUT. |
||||||
|
</ul> |
||||||
|
|
||||||
|
<p>See the git repository for a more detailed README.</p> |
||||||
|
|
||||||
|
<h2>Source code</h2> |
||||||
|
|
||||||
|
<p>Post-it is written in Rust.</p> |
||||||
|
|
||||||
|
<p>Get the sources at: <a href="https://git.ondrovo.com/MightyPork/postit">https://git.ondrovo.com/MightyPork/postit</a></p> |
||||||
|
|
||||||
|
</body> |
||||||
|
</html> |
Loading…
Reference in new issue