gsl/index.h

64 lines
2.3 KiB
C
Raw Normal View History

const char *INDEX_HTML = // FIXME: Change this to licenses.sneedmc.org index. Maybe dynamically generate some crap
"<!DOCTYPE html>\r\n"
"<html lang=en>\r\n"
" <head>\r\n"
" <title>A Minimal, Filesystem-Backed URL Shortener</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, minimal, and filesystem-backed URL Shortener.' name='description'>\r\n"
" </head>\r\n"
" <body style='font-family: monospace; max-width: 80ch;'>\r\n"
"\r\n"
"<header>\r\n"
"A Minimal, Filesystem-Backed URL Shortener\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. Create a short link to https://duckduckgo.com\r\n"
" $ curl -d https://duckduckgo.com %s\r\n"
" %s/502fb5543c36014f\r\n"
"\r\n"
" 2. Create a short link with a custom path\r\n"
" $ curl -d https://duckduckgo.com %s/ddg\r\n"
" %s/ddg\r\n"
"\r\n"
" 3. Create a short link to https://duckduckgo.com using a query string\r\n"
" $ curl %s?https://duckduckgo.com\r\n"
" %s/1acd382417199d7e\r\n"
"\r\n"
" 4. Create a short link with a custom path using a query string\r\n"
" $ curl %s/ddg?https://duckduckgo.com\r\n"
" %s/ddg\r\n"
"\r\n"
" 5. Deleting a short link\r\n"
" $ TMP=$(mktemp)\r\n"
" $ LINK=$(curl -sS %s -d https://duckduckgo.com -D $TMP)\r\n"
" $ # Link 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"
" &lt;a href=&quot;https://duckduckgo.com&quot;&gt;Permanent Redirect&lt;/a&gt;.\r\n"
" $ curl $LINK -X DELETE -d $DEL\r\n"
" $ curl $LINK\r\n"
" this short link does not exist\r\n"
" $ # Link has been deleted</code></pre>\r\n"
"\r\n"
"<footer style='white-space: pre;'>Source code: <a href='https://short.swurl.xyz/src'>short.swurl.xyz/src</a></a>\r\n"
"</footer>\r\n"
"</html>\r\n";