doc: update README for GFM syntax
This commit is contained in:
parent
b562ca4bd4
commit
33ca03b9d7
42
README.md
42
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.
|
||||
|
||||
`<script type="text/javascript" src="SERVER_ADDR/sdk.js"></script>
|
||||
```html
|
||||
<script type="text/javascript" src="SERVER_ADDR/sdk.js"></script>
|
||||
contented.init("#target", function(/* String[] */ items) {});
|
||||
`
|
||||
```
|
||||
|
||||
=CHANGELOG=
|
||||
## Changelog
|
||||
|
||||
NEXT:
|
||||
- Feature: Option to limit concurrent thumbnail generation
|
||||
|
Loading…
Reference in New Issue
Block a user