update docs to reflect api changes

This commit is contained in:
2018-06-07 21:03:35 +02:00
parent 7cf7924b96
commit f067eabd05
6 changed files with 20 additions and 22 deletions

2
.gitignore vendored
View File

@@ -1,3 +1,3 @@
.vscode
main
pdwebconfig.toml
pdwebconf.toml

View File

@@ -11,7 +11,7 @@ import (
var vi *viper.Viper
var defaultConfig = `# Pixeldrain Web UI server configuration
api_url_external = "/api" # Used in the web browser, can be a relative path
api_url_external = "https://sia.pixeldrain.com/api" # Used in the web browser, should be a full URL. Not ending with a slash
api_url_internal = "http://127.0.0.1:8080/api" # Used for internal API requests to the pixeldrain server, not visible to users
static_resource_dir = "res/static"
template_dir = "res/template"

View File

@@ -43,7 +43,20 @@
resource <strong>do</strong> require an API key.
<br/>
<br/>
Though API keys have not been implemented yet.
Though API keys have not been implemented yet, so you can't use
those methods yet.
</p>
<p>
Some JSON responses include fields which end in "_href" (some
people don't know this, but "href" stands for "Hypertext
Reference", the more you know). These point to different places
in the API, which you can retrieve with a GET request. The path
is to be appended to the API URL, so "/file/someid/thumbnail"
becomes "{{apiUrl}}/file/someid/thumbnail".
</p>
<p>
The base URL for the API is "{{apiUrl}}", all paths below are
relative to that URL.
</p>
<h2>File Methods</h2>

View File

@@ -26,17 +26,10 @@
<tr>
<td>name</td>
<td>false</td>
<td>300 Characters</td>
<td>Name of file param</td>
<td>255 Characters</td>
<td>Multipart file name</td>
<td>Name of the file to upload</td>
</tr>
<tr>
<td>description</td>
<td>false</td>
<td>5000 Characters</td>
<td>Pixeldrain File</td>
<td>Description of the file</td>
</tr>
</table>
<h3>Returns</h3>
@@ -73,13 +66,7 @@
{
"success": false,
"value": "name_too_long",
"message": "File Name is too long, Max 300 characters allowed."
}</pre>
<pre>HTTP 413: Payload Too Large
{
"success": false,
"value": "description_too_long",
"message": "File Description is too long, Max 5000 characters allowed."
"message": "File Name is too long, Max 255 characters allowed."
}</pre>
</div>
</details>

View File

@@ -15,8 +15,6 @@
<link rel="icon" sizes="180x180" href="res/img/pixeldrain.png"/>
<link rel="icon" sizes="256x256" href="res/img/pixeldrain_big.png"/>
<style th:include="fragments :: background-pattern" th:inline="text"></style>
<script src="/res/script/jquery-2.1.4.min.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css"/>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>

View File

@@ -10,9 +10,9 @@ import (
"path/filepath"
"strings"
"fornaxian.com/pixeldrain-api/log"
"fornaxian.com/pixeldrain-web/conf"
"fornaxian.com/pixeldrain-web/pixelapi"
"github.com/Fornaxian/log"
"github.com/julienschmidt/httprouter"
"github.com/timakin/gonvert"