Goddamit, emacs

This commit is contained in:
(≧◡≦) 2023-02-12 13:44:09 +01:00
parent 4fcd649b0b
commit 4b06627b0a
No known key found for this signature in database
GPG key ID: B39C0BCEE94A4A89

View file

@ -96,45 +96,48 @@ get '/f/:dir/#name' => sub ($c) {
content_disposition => 'inline' content_disposition => 'inline'
) )
}; }
app->max_request_size( 1024 * 1024 * 100 ); ;
app->max_request_size( 1024 * 1024 * 100 );
post '/upload' => sub ($c) { handle_file($c) }; post '/upload' => sub ($c) { handle_file($c) };
app->start; app->start;
# Index template # Index template
#By default Mojolicious gets the "directory root" from the "public" #By default Mojolicious gets the "directory root" from the "public"
# directory, so the css and the favicon from the "public" directory, # directory, so the css and the favicon from the "public" directory,
# in the root of this repo. # in the root of this repo.
__DATA__
__DATA__
@@ index.html.ep @@ index.html.ep
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<title>sakisafe</title> <title>sakisafe</title>
<link rel="stylesheet" type="text/css" href="index.css"/> <link rel="stylesheet" type="text/css" href="index.css"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head> </head>
<body> <body>
<center> <center>
<h1>sakisafe</h1> <h1>sakisafe</h1>
<h2>shitless file upload, pastebin and url shorter</h2> <h2>shitless file upload, pastebin and url shorter</h2>
<img src="saki.png"/> <img src="saki.png"/>
<h2>USAGE</h2> <h2>USAGE</h2>
<p>POST a file:</p> <p>POST a file:</p>
<code>curl -F 'file=@yourfile.png' https://<%= $c->req->url->to_abs->host; %></code> <code>curl -F 'file=@yourfile.png' https://<%= $c->req->url->to_abs->host; %></code>
<p>Post your text directly</p> <p>Post your text directly</p>
<code>curl -F 'file=@-' https://<%= $c->req->url->to_abs->host; %></code> <code>curl -F 'file=@-' https://<%= $c->req->url->to_abs->host; %></code>
</center> </center>
<div class="left"> <div class="left">
<h2>Or just upload a file here</h2> <h2>Or just upload a file here</h2>
<form ENCTYPE='multipart/form-data' method='post' action='/upload'> <form ENCTYPE='multipart/form-data' method='post' action='/upload'>
<input type='file' name='file' size='30'/> <input type='file' name='file' size='30'/>
<input type='submit' value='upload'/> <input type='submit' value='upload'/>
</form> </form>
</div> </div>
</body> </body>
</html> </html>