trance/index.h

56 lines
1.9 KiB
C

const char *INDEX_HTML =
"<!DOCTYPE html>\r\n"
"<html lang=en>\r\n"
" <head>\r\n"
" <title>A Minimal, Dead-Simple File Upload Service</title>\r\n"
" <meta charset='utf-8'>\r\n"
" <meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>\r\n"
" <meta http-equiv='Content-Type' content='text/html; charset=utf-8'>\r\n"
" <meta name='viewport' content='width=device-width, initial-scale=1'>\r\n"
" <meta content='A super simple and minimal file upload service.' name='description'>\r\n"
" </head>\r\n"
" <body style='font-family: monospace; max-width: 80ch;'>\r\n"
"\r\n"
"<header>\r\n"
"A Minimal, Dead-Simple File Upload Service\r\n"
"</header>\r\n"
"\r\n"
"<style>\r\n"
"@media (max-width: 1000px) {\r\n"
" pre code {\r\n"
" display: block;\r\n"
" max-width: 100%%;\r\n"
" overflow-x: auto;\r\n"
" -webkit-overflow-scrolling: touch;\r\n"
" padding: 0 5px 5px 0;\r\n"
" }\r\n"
"}\r\n"
"</style>\r\n"
"\r\n"
"<pre><code>Examples:\r\n"
" 1. Upload some content\r\n"
" $ curl -d \"some content\" %s/content.txt\r\n"
" %s/41789941bf7ea0ee/content.txt\r\n"
"\r\n"
" 2. Upload some content from a file\r\n"
" $ curl %s/content.txt --data-binary @content.txt\r\n"
" %s/4466af6a05b4cc29/content.txt\r\n"
"\r\n"
" 3. Deleting a file\r\n"
" $ TMP=$(mktemp)\r\n"
" $ LINK=$(curl -sS %s/content.txt -d \"some content\" -D $TMP)\r\n"
" $ # File created, headers stored in temp file\r\n"
" $ DEL=$(cat $TMP | grep -i delete-with | awk '{print$2}'| tr -d '\\r')\r\n"
" $ # Gets the deletion key, in the 'X-Delete-With' header\r\n"
" $ curl $LINK\r\n"
" some content\r\n"
" $ curl $LINK -X DELETE -d $DEL\r\n"
" $ curl $LINK\r\n"
" Not found\r\n"
" $ # File has been deleted</code></pre>\r\n"
"\r\n"
"<footer style='white-space: pre;'>Source code: <a href='https://short.swurl.xyz/trance'>short.swurl.xyz/trance</a></a>\r\n"
"</footer>\r\n"
"</html>\r\n";