From 33ca03b9d73ed01656b7aa3ee764c565a498e7d0 Mon Sep 17 00:00:00 2001 From: mappu Date: Sat, 6 Oct 2018 13:49:20 +1300 Subject: [PATCH] doc: update README for GFM syntax --- README.md | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 8ce892f..3c5c45e 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,17 @@ -A file / image / paste upload server with a focus on embedding. +# contented -Written in Go +[![](doc/image1.thumb.png)](doc/image1.png) + +A file / image / paste upload server with a focus on embedding. You can use contented as a standalone upload server, or you can use the SDK to embed its upload widget into another website. -[go-get]code.ivysaur.me/contented git https://git.ivysaur.me/code.ivysaur.me/contented.git[/go-get] - -=FEATURES= +## Features - Drag and drop upload - Multiple files upload - Pastebin upload -- Custom drawing upload ([url=https://github.com/Leimi/drawingboard.js]via[/url]) +- Custom drawing upload ([via drawingboard.js](https://github.com/Leimi/drawingboard.js)) - Ctrl-V upload - SDK-oriented design for embedding, including CORS support - Mobile friendly HTML interface @@ -19,12 +19,13 @@ You can use contented as a standalone upload server, or you can use the SDK to e - Hash verification (SHA512/256) - Detect duplicate upload content and reuse storage - Options to limit the upload filesize and the upload bandwidth -- Short URLs (using [url=http://hashids.org]Hashids[/url] algorithm) +- Short URLs (using [Hashids](http://hashids.org) algorithm) - Image thumbnailing -=USAGE (SERVER)= +## Usage (Server) -`Usage of contented: +``` +Usage of contented: -data string Directory for stored content (default "") -db string @@ -45,28 +46,31 @@ You can use contented as a standalone upload server, or you can use the SDK to e Trust X-Forwarded-For reverse proxy headers -concurrentthumbs Simultaneous thumbnail generation (default 16) -` +``` If you are hosting behind a reverse proxy, remember to set its post body size parameter appropriately (e.g. `client_max_body_size` for nginx). -=USAGE (HTTP)= +## Usage (HTTP) The server responds on the following URLs: -- `/get/{ID}`: Download item content -- `/info/{ID}`: Get item content metadata (JSON) -- `/thumb/{Type}/{ID}`: Get item thumbnail image -- `/about`: Get server metadata (JSON) +URL |Method |Description +---------------------|-------|-- +`/get/{ID}` |`GET` |Download item content +`/info/{ID}` |`GET` |Get item content metadata (JSON) +`/thumb/{Type}/{ID}` |`GET` |Get item thumbnail image +`/about` |`GET` |Get server metadata (JSON) -=USAGE (EMBEDDING FOR WEB)= +## Usage (Embedding for web) Your webpage should load the SDK from the contented server, then call the `contented.init` function to display the upload widget over the top of an existing DOM element. Your callback will be passed an array of file IDs of any uploaded items. -` +```html + contented.init("#target", function(/* String[] */ items) {}); -` +``` -=CHANGELOG= +## Changelog NEXT: - Feature: Option to limit concurrent thumbnail generation