a simple url shortener in Go (check it out at qurl.org)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.4 KiB

<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>qurl.org - API usage</title>
body { font-size: 14px; }
pre { font-size: 12px; border-left: 3px solid blue; padding-left: 10px; }
ul { margin: 0px; padding: 0px; }
li { margin: 0px 0px 0px 20px; padding: 0px; }
<h1>API usage</h1>
<p>API URL: http://qurl.org/api/url</p>
<ul>Parameters (GET or POST)
<li><b>url</b> The url to be shortened</li>
<ul>JSON Response
<li><b>url</b> <i>(string)</i> the shortened url (e.g. http://qurl.org/0)</li>
<li><b>exists</b> <i>(boolean)</i> true if the provided URL was already in the database</li>
<li><b>error</b> <i>(string)</i> error message if url could not be shortened (e.g. "Invalid URL")</li>
<h1>API example</h1>
<b>Response:</b><pre>{"error":"Not a valid URL."}</pre>