Commit e20ffb39 authored by Marco Flowers's avatar Marco Flowers

Added apidocs to describe the api

Added the apidocs module and comments in app.js to describe
the different api endpoints.
parent 4f6c0fa2
define({ "api": [ { "type": "get", "url": "/formats/", "title": "Get a list of Formats", "name": "GetFormats", "group": "Formats", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "<p>List</p> ", "optional": false, "field": "-", "description": "<p>List of formats</p> " } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n[\n {\"val\":\"Vorbis\"},\n {\"val\":\"MP3\"}\n]", "type": "json" } ] }, "version": "0.0.0", "filename": "./app.js", "groupTitle": "Formats" }, { "type": "get", "url": "/genres/", "title": "Get a list of Genres", "name": "GetGenres", "group": "Genres", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "<p>List</p> ", "optional": false, "field": "-", "description": "<p>List of genres</p> " } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n[\n {\"val\":\"Rock\"},\n {\"val\":\"Pop\"}\n]", "type": "json" } ] }, "version": "0.0.0", "filename": "./app.js", "groupTitle": "Genres" }, { "type": "get", "url": "/streams/:id", "title": "Get Individual Stream", "name": "GetStream", "group": "Streams", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "<p>Number</p> ", "optional": false, "field": "id", "description": "<p>Stream unique ID.</p> " } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "<p>Object</p> ", "optional": false, "field": "_", "description": "<p>Describes the stream</p> " } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"id\":8,\n \"stream_name\":\"TestStream7\",\n \"stream_type\":\"audio/ogg\",\n \"description\":\"Really Cool Stream\",\n \"songname\":\"TestSong\",\n \"url\":\"http://fake.com\",\n \"avg_listening_time\":null,\n \"codec_sub_types\":[\"Vorbis\"],\n \"bitrate\":128,\n \"hits\":null,\n \"cm\":null,\n \"samplerate\":44100,\n \"channels\":2,\n \"quality\":null,\n \"genres\":[\"Rock\"],\n \"listenurls\":[\"http://fake.com:8000/stream\"],\n \"listeners\":3,\n \"max_listeners\":100\n}", "type": "json" } ] }, "error": { "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 404 Not Found\n{\n}", "type": "json" } ] }, "version": "0.0.0", "filename": "./app.js", "groupTitle": "Streams" }, { "type": "get", "url": "/streams/", "title": "Get a list of Streams", "name": "GetStreams", "group": "Streams", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "<p>String</p> ", "optional": false, "field": "format", "description": "<p>Format to search by.</p> " }, { "group": "Parameter", "type": "<p>String</p> ", "optional": false, "field": "genre", "description": "<p>Genre to seach by.</p> " }, { "group": "Parameter", "type": "<p>String</p> ", "optional": false, "field": "q", "description": "<p>Search string.</p> " }, { "group": "Parameter", "type": "<p>Number</p> ", "allowedValues": [ "-1", "0", "1" ], "optional": false, "field": "order", "description": "<p>-1=Random order 0=Descending 1=Ascending.</p> " }, { "group": "Parameter", "type": "<p>Number</p> ", "optional": false, "field": "limit", "description": "<p>Number of results to return.</p> " }, { "group": "Parameter", "type": "<p>Number</p> ", "optional": false, "field": "starting_after", "description": "<p>ID of stream to return results after(Requires order, cannot have ending_before).</p> " }, { "group": "Parameter", "type": "<p>Number</p> ", "optional": false, "field": "ending_before", "description": "<p>ID of stream to return results before(Requires order, cannot have starting_after).</p> " } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "<p>List</p> ", "optional": false, "field": "streams", "description": "<p>List of stream objects(See get individual stream for an example)</p> " }, { "group": "Success 200", "type": "<p>Object</p> ", "optional": false, "field": "data", "description": "<p>Contains starting_after and ending_before urls for this data</p> " } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"streams\":[],\n \"data\":{\"starting_after\":\"/streams?limit=2&starting_after=20\"},\n}\nView getting a single stream to see what the stream data will look like", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "<p>String</p> ", "optional": false, "field": "error", "description": "<p>Contains an error message describing the issue</p> " } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 400 Bad Request\n{\n \"error\":\"error message describing issue\"\n}", "type": "json" } ] }, "version": "0.0.0", "filename": "./app.js", "groupTitle": "Streams" }, { "success": { "fields": { "Success 200": [ { "group": "Success 200", "optional": false, "field": "varname1", "description": "<p>No type.</p> " }, { "group": "Success 200", "type": "<p>String</p> ", "optional": false, "field": "varname2", "description": "<p>With type.</p> " } ] } }, "type": "", "url": "", "version": "0.0.0", "filename": "./apidoc/main.js", "group": "_Users_marcof_Documents_icecast_directory_apidoc_main_js", "groupTitle": "_Users_marcof_Documents_icecast_directory_apidoc_main_js", "name": "" }] });
\ No newline at end of file
[ { "type": "get", "url": "/formats/", "title": "Get a list of Formats", "name": "GetFormats", "group": "Formats", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "<p>List</p> ", "optional": false, "field": "-", "description": "<p>List of formats</p> " } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n[\n {\"val\":\"Vorbis\"},\n {\"val\":\"MP3\"}\n]", "type": "json" } ] }, "version": "0.0.0", "filename": "./app.js", "groupTitle": "Formats" }, { "type": "get", "url": "/genres/", "title": "Get a list of Genres", "name": "GetGenres", "group": "Genres", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "<p>List</p> ", "optional": false, "field": "-", "description": "<p>List of genres</p> " } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n[\n {\"val\":\"Rock\"},\n {\"val\":\"Pop\"}\n]", "type": "json" } ] }, "version": "0.0.0", "filename": "./app.js", "groupTitle": "Genres" }, { "type": "get", "url": "/streams/:id", "title": "Get Individual Stream", "name": "GetStream", "group": "Streams", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "<p>Number</p> ", "optional": false, "field": "id", "description": "<p>Stream unique ID.</p> " } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "<p>Object</p> ", "optional": false, "field": "_", "description": "<p>Describes the stream</p> " } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"id\":8,\n \"stream_name\":\"TestStream7\",\n \"stream_type\":\"audio/ogg\",\n \"description\":\"Really Cool Stream\",\n \"songname\":\"TestSong\",\n \"url\":\"http://fake.com\",\n \"avg_listening_time\":null,\n \"codec_sub_types\":[\"Vorbis\"],\n \"bitrate\":128,\n \"hits\":null,\n \"cm\":null,\n \"samplerate\":44100,\n \"channels\":2,\n \"quality\":null,\n \"genres\":[\"Rock\"],\n \"listenurls\":[\"http://fake.com:8000/stream\"],\n \"listeners\":3,\n \"max_listeners\":100\n}", "type": "json" } ] }, "error": { "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 404 Not Found\n{\n}", "type": "json" } ] }, "version": "0.0.0", "filename": "./app.js", "groupTitle": "Streams" }, { "type": "get", "url": "/streams/", "title": "Get a list of Streams", "name": "GetStreams", "group": "Streams", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "<p>String</p> ", "optional": false, "field": "format", "description": "<p>Format to search by.</p> " }, { "group": "Parameter", "type": "<p>String</p> ", "optional": false, "field": "genre", "description": "<p>Genre to seach by.</p> " }, { "group": "Parameter", "type": "<p>String</p> ", "optional": false, "field": "q", "description": "<p>Search string.</p> " }, { "group": "Parameter", "type": "<p>Number</p> ", "allowedValues": [ "-1", "0", "1" ], "optional": false, "field": "order", "description": "<p>-1=Random order 0=Descending 1=Ascending.</p> " }, { "group": "Parameter", "type": "<p>Number</p> ", "optional": false, "field": "limit", "description": "<p>Number of results to return.</p> " }, { "group": "Parameter", "type": "<p>Number</p> ", "optional": false, "field": "starting_after", "description": "<p>ID of stream to return results after(Requires order, cannot have ending_before).</p> " }, { "group": "Parameter", "type": "<p>Number</p> ", "optional": false, "field": "ending_before", "description": "<p>ID of stream to return results before(Requires order, cannot have starting_after).</p> " } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "<p>List</p> ", "optional": false, "field": "streams", "description": "<p>List of stream objects(See get individual stream for an example)</p> " }, { "group": "Success 200", "type": "<p>Object</p> ", "optional": false, "field": "data", "description": "<p>Contains starting_after and ending_before urls for this data</p> " } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n \"streams\":[],\n \"data\":{\"starting_after\":\"/streams?limit=2&starting_after=20\"},\n}\nView getting a single stream to see what the stream data will look like", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "<p>String</p> ", "optional": false, "field": "error", "description": "<p>Contains an error message describing the issue</p> " } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 400 Bad Request\n{\n \"error\":\"error message describing issue\"\n}", "type": "json" } ] }, "version": "0.0.0", "filename": "./app.js", "groupTitle": "Streams" }, { "success": { "fields": { "Success 200": [ { "group": "Success 200", "optional": false, "field": "varname1", "description": "<p>No type.</p> " }, { "group": "Success 200", "type": "<p>String</p> ", "optional": false, "field": "varname2", "description": "<p>With type.</p> " } ] } }, "type": "", "url": "", "version": "0.0.0", "filename": "./apidoc/main.js", "group": "_Users_marcof_Documents_icecast_directory_apidoc_main_js", "groupTitle": "_Users_marcof_Documents_icecast_directory_apidoc_main_js", "name": "" }]
\ No newline at end of file
define({ "name": "Icecast Stream Directory API", "version": "0.0.0", "description": "Stream directory api", "title": "Icecast Stream Directory API", "url": "", "order": [ "Streams", "Genres", "Formats" ], "sampleUrl": false, "apidoc": "0.2.0", "generator": { "name": "apidoc", "time": "2015-08-11T07:35:10.997Z", "url": "http://apidocjs.com", "version": "0.13.1" }});
\ No newline at end of file
{ "name": "Icecast Stream Directory API", "version": "0.0.0", "description": "Stream directory api", "title": "Icecast Stream Directory API", "url": "", "order": [ "Streams", "Genres", "Formats" ], "sampleUrl": false, "apidoc": "0.2.0", "generator": { "name": "apidoc", "time": "2015-08-11T07:35:10.997Z", "url": "http://apidocjs.com", "version": "0.13.1" }}
\ No newline at end of file
/* ------------------------------------------------------------------------------------------
* Content
* ------------------------------------------------------------------------------------------ */
body {
min-width: 980px;
max-width: 1280px;
}
body, p, a, div, th, td {
font-family: "Source Sans Pro", sans-serif;
font-weight: 400;
font-size: 16px;
}
td.code {
font-size: 14px;
font-family: "Source Code Pro";
font-style: normal;
font-weight: 400;
}
#content {
padding-top: 16px;
z-Index: -1;
margin-left: 270px;
}
p {
color: #808080;
}
h1 {
font-family: "Source Sans Pro Semibold", sans-serif;
font-weight: normal;
font-size: 44px;
line-height: 50px;
margin: 0 0 10px 0;
padding: 0;
}
h2 {
font-family: "Source Sans Pro", sans-serif;
font-weight: normal;
font-size: 24px;
line-height: 40px;
margin: 0 0 20px 0;
padding: 0;
}
section {
border-top: 1px solid #ebebeb;
padding: 30px 0;
}
section h1 {
font-family: "Source Sans Pro", sans-serif;
font-weight: 700;
font-size: 32px;
line-height: 40px;
padding-bottom: 14px;
margin: 0 0 20px 0;
padding: 0;
}
article {
padding: 14px 0 30px 0;
}
article h1 {
font-family: "Source Sans Pro Bold", sans-serif;
font-weight: 600;
font-size: 24px;
line-height: 26px;
}
article h2 {
font-family: "Source Sans Pro", sans-serif;
font-weight: 600;
font-size: 18px;
line-height: 24px;
margin: 0 0 10px 0;
}
article h3 {
font-family: "Source Sans Pro", sans-serif;
font-weight: 600;
font-size: 16px;
line-height: 18px;
margin: 0 0 10px 0;
}
article h4 {
font-family: "Source Sans Pro", sans-serif;
font-weight: 600;
font-size: 14px;
line-height: 16px;
margin: 0 0 8px 0;
}
table {
border-collapse: collapse;
width: 100%;
margin: 0 0 20px 0;
}
th {
background-color: #f5f5f5;
text-align: left;
font-family: "Source Sans Pro", sans-serif;
font-weight: 700;
padding: 4px 8px;
border: #e0e0e0 1px solid;
}
td {
vertical-align: top;
padding: 2px 8px;
border: #e0e0e0 1px solid;
}
#generator .content {
color: #b0b0b0;
border-top: 1px solid #ebebeb;
padding: 10px 0;
}
.label-optional {
float: right;
}
.open-left {
right: 0;
left: auto;
}
/* ------------------------------------------------------------------------------------------
* apidoc - intro
* ------------------------------------------------------------------------------------------ */
#apidoc .apidoc {
border-top: 1px solid #ebebeb;
padding: 30px 0;
}
#apidoc h1 {
font-family: "Source Sans Pro", sans-serif;
font-weight: 700;
font-size: 32px;
line-height: 40px;
padding-bottom: 14px;
margin: 0 0 20px 0;
padding: 0;
}
#apidoc h2 {
font-family: "Source Sans Pro Bold", sans-serif;
font-weight: 600;
font-size: 22px;
line-height: 26px;
padding-top: 14px;
}
/* ------------------------------------------------------------------------------------------
* pre / code
* ------------------------------------------------------------------------------------------ */
pre {
background-color: #292b36;
color: #ffffff;
padding: 10px;
border-radius: 6px;
position: relative;
margin: 10px 0 20px 0;
}
code.language-text {
word-wrap: break-word;
}
pre.language-json {
overflow: auto;
}
pre.language-html {
margin: 40px 0 20px 0;
}
pre.language-html:before {
content: attr(data-type);
position: absolute;
top: -30px;
left: 0;
font-family: "Source Sans Pro", sans-serif;
font-weight: 600;
font-size: 15px;
display: inline-block;
padding: 2px 5px;
border-radius: 6px;
text-transform: uppercase;
background-color: #3387CC;
color: #ffffff;
}
pre.language-html[data-type="get"]:before {
background-color: green;
}
pre.language-html[data-type="put"]:before {
background-color: #e5c500;
}
pre.language-html[data-type="post"]:before {
background-color: #4070ec;
}
pre.language-html[data-type="delete"]:before {
background-color: #ed0039;
}
pre.language-api .str {
color: #ffffff;
}
pre.language-api .pln,
pre.language-api .pun {
color: #65B042;
}
pre code {
display: block;
font-size: 14px;
font-family: "Source Code Pro";
font-style: normal;
font-weight: 400;
word-wrap: normal;
white-space: pre;
}
/*
pre.language-json {
background: #f5f5f5;
border: #e0e0e0 1px solid;
}
pre.language-json .pln,
pre.language-json .pun {
color: #3a3a3a;
}
*/
/* ------------------------------------------------------------------------------------------
* Sidenav
* ------------------------------------------------------------------------------------------ */
.sidenav {
width: 228px;
margin: 0;
padding: 20px;
position: fixed;
top: 0;
left: 0;
bottom: 0;
overflow-x: hidden;
overflow-y: auto;
background-color: #f5f5f5;
z-index: 10;
}
.sidenav > li > a {
display: block;
width: 192px;
margin: 0;
padding: 2px 11px;
border: 0;
border-left: transparent 4px solid;
border-right: transparent 4px solid;
font-family: "Source Sans Pro", sans-serif;
font-weight: 400;
font-size: 14px;
}
.sidenav > li.nav-header > a {
padding: 5px 15px;
border: 1px solid #e5e5e5;
width: 190px;
font-family: "Source Sans Pro", sans-serif;
font-weight: 700;
font-size: 16px;
background-color: #ffffff;
}
.sidenav > li.nav-header.active > a {
background-color: #0088cc;
}
.sidenav > .active > a {
position: relative;
z-index: 2;
}
.sidenav > li > a:hover {
background-color: #ffffff;
}
.sidenav > li.has-modifications a {
border-right: #60d060 4px solid;
}
.sidenav > li.is-new a {
border-left: #e5e5e5 4px solid;
}
/* ------------------------------------------------------------------------------------------
* Compare
* ------------------------------------------------------------------------------------------ */
ins {
background: #60d060;
text-decoration: none;
color: #000000;
}
del {
background: #f05050;
color: #000000;
}
.label-ins {
background-color: #60d060;
}
.label-del {
background-color: #f05050;
text-decoration: line-through;
}
pre.ins {
background-color: #60d060;
}
pre.del {
background-color: #f05050;
text-decoration: line-through;
}
table.ins th,
table.ins td {
background-color: #60d060;
}
table.del th,
table.del td {
background-color: #f05050;
text-decoration: line-through;
}
tr.ins td {
background-color: #60d060;
}
tr.del td {
background-color: #f05050;
text-decoration: line-through;
}
/* ------------------------------------------------------------------------------------------
* Spinner
* ------------------------------------------------------------------------------------------ */
#loader {
position: absolute;
width: 100%;
}
#loader p {
padding-top: 80px;
margin-left: -4px;
}
.spinner {
margin: 200px auto;
width: 60px;
height: 60px;
position: relative;
}
.container1 > div, .container2 > div, .container3 > div {
width: 14px;
height: 14px;
background-color: #0088cc;
border-radius: 100%;
position: absolute;
-webkit-animation: bouncedelay 1.2s infinite ease-in-out;
animation: bouncedelay 1.2s infinite ease-in-out;
/* Prevent first frame from flickering when animation starts */
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
.spinner .spinner-container {
position: absolute;
width: 100%;
height: 100%;
}
.container2 {
-webkit-transform: rotateZ(45deg);
transform: rotateZ(45deg);
}
.container3 {
-webkit-transform: rotateZ(90deg);
transform: rotateZ(90deg);
}
.circle1 { top: 0; left: 0; }
.circle2 { top: 0; right: 0; }
.circle3 { right: 0; bottom: 0; }
.circle4 { left: 0; bottom: 0; }
.container2 .circle1 {
-webkit-animation-delay: -1.1s;
animation-delay: -1.1s;
}
.container3 .circle1 {
-webkit-animation-delay: -1.0s;
animation-delay: -1.0s;
}
.container1 .circle2 {
-webkit-animation-delay: -0.9s;
animation-delay: -0.9s;
}
.container2 .circle2 {
-webkit-animation-delay: -0.8s;
animation-delay: -0.8s;
}
.container3 .circle2 {
-webkit-animation-delay: -0.7s;
animation-delay: -0.7s;
}
.container1 .circle3 {
-webkit-animation-delay: -0.6s;
animation-delay: -0.6s;
}
.container2 .circle3 {
-webkit-animation-delay: -0.5s;
animation-delay: -0.5s;
}
.container3 .circle3 {
-webkit-animation-delay: -0.4s;
animation-delay: -0.4s;
}
.container1 .circle4 {
-webkit-animation-delay: -0.3s;
animation-delay: -0.3s;
}
.container2 .circle4 {
-webkit-animation-delay: -0.2s;
animation-delay: -0.2s;
}
.container3 .circle4 {
-webkit-animation-delay: -0.1s;
animation-delay: -0.1s;
}
@-webkit-keyframes bouncedelay {
0%, 80%, 100% { -webkit-transform: scale(0.0) }
40% { -webkit-transform: scale(1.0) }
}
@keyframes bouncedelay {
0%, 80%, 100% {
transform: scale(0.0);
-webkit-transform: scale(0.0);
} 40% {
transform: scale(1.0);
-webkit-transform: scale(1.0);
}
}
/* ------------------------------------------------------------------------------------------
* Tabs
* ------------------------------------------------------------------------------------------ */
ul.nav-tabs {
margin: 0;
}
/* ------------------------------------------------------------------------------------------
* Print
* ------------------------------------------------------------------------------------------ */
@media print {
#sidenav,
#version,
#versions,
section .version,
section .versions {
display: none;
}
#content {
margin-left: 0;
}
a {
text-decoration: none;
color: inherit;
}
a:after {
content: " [" attr(href) "] ";
}
p {
color: #000000
}
pre {
background-color: #ffffff;
color: #000000;
padding: 10px;
border: #808080 1px solid;
border-radius: 6px;
position: relative;
margin: 10px 0 20px 0;
}
} /* /@media print */
<!DOCTYPE html>
<html>
<head>
<title>Loading...</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="vendor/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="vendor/prettify.css" rel="stylesheet" media="screen">
<link href="css/style.css" rel="stylesheet" media="screen, print">
<link href="img/favicon.ico" rel="icon" type="image/x-icon">
<script src="vendor/polyfill.js"></script>
</head>
<body>
<script id="template-sidenav" type="text/x-handlebars-template">
<nav id="scrollingNav">
<ul class="sidenav nav nav-list">
{{#each nav}}
{{#if title}}
{{#if isHeader}}
{{#if isFixed}}
<li class="nav-fixed nav-header" data-group="{{group}}"><a href="#api-{{group}}">{{underscoreToSpace title}}</a></li>
{{else}}
<li class="nav-header" data-group="{{group}}"><a href="#api-{{group}}">{{underscoreToSpace title}}</a></li>
{{/if}}
{{else}}
<li {{#if hidden}}class="hide" {{/if}}data-group="{{group}}" data-name="{{name}}" data-version="{{version}}">
<a href="#api-{{group}}-{{name}}">{{title}}</a>
</li>
{{/if}}
{{/if}}
{{/each}}
</ul>
</nav>
</script>
<script id="template-project" type="text/x-handlebars-template">
<div class="pull-left">
<h1>{{name}}</h1>
{{#if description}}<h2>{{{nl2br description}}}</h2>{{/if}}
</div>
{{#if template.withCompare}}
<div class="pull-right">
<div class="btn-group">
<button id="version" class="btn btn-large dropdown-toggle" data-toggle="dropdown">
<strong>{{version}}</strong> <span class="caret"></span>
</button>
<ul id="versions" class="dropdown-menu open-left">
<li><a id="compareAllWithPredecessor" href="#">{{__ "Compare all with predecessor"}}</a></li>
<li class="divider"></li>
<li class="disabled"><a href="#">{{__ "show up to version:"}}</a></li>
{{#each versions}}
<li class="version"><a href="#">{{this}}</a></li>
{{/each}}
</ul>
</div>
</div>