Update README.
README.md
| 1 | 1 | # guile-pastebin | |
| 2 | + | ||
| 2 | 3 | A very simple pastebin written in Guile Scheme. | |
| 3 | 4 | ||
| 4 | 5 | ## How to run | |
… | |||
| 12 | 13 | It was tested on Guile 2.2.7 and 3.0.7. Many thanks to the Guile | |
| 13 | 14 | development team for such great software. | |
| 14 | 15 | ||
| 16 | + | ## API | |
| 17 | + | ||
| 18 | + | - `/post` -- create paste | |
| 19 | + | - method: POST only | |
| 20 | + | - type: `multipart/form-data` | |
| 21 | + | - fields | |
| 22 | + | - `text` -- the paste content | |
| 23 | + | - `showUrl=1` -- to show the raw URL after paste | |
| 24 | + | - `/raw/<ID>` -- get paste content | |
| 25 | + | - method: GET only | |
| 26 | + | - Anything else -- show top 5 paste list | |
| 27 | + | ||
| 28 | + | ## Paste a file from command line | |
| 29 | + | ||
| 30 | + | Paste a text file from command line and get a URL back: | |
| 31 | + | `curl -F "text=<helloworld.cs" -F showUrl=1 http://localhost:8080/post` | |
| 32 | + | ||
| 33 | + | Notice the double-quotes around the parameters because `<` means IO | |
| 34 | + | redirection in sh. | |
| 35 | + | ||
| 15 | 36 | ## Reverse Proxy | |
| 16 | 37 | ||
| 17 | 38 | It may be desirable to setup a reverse proxy on Apache Httpd (also a memo | |
| 18 | 39 | for myself), so you don't have to expose the 8080 or whatever port: | |
| 19 | 40 | ||
| 20 | 41 | ``` | |
| 21 | - | <Location "/pastebin"> | |
| 22 | - | ProxyPass "http://your_address:8080" | |
| 23 | - | ProxyPassReverse "http://your_address:8080" | |
| 24 | - | ProxyHTMLEnable On | |
| 25 | - | ProxyHTMLDocType "<!DOCTYPE html>" | |
| 26 | - | ProxyHTMLURLMap "/" "/pastebin/" | |
| 27 | - | </Location> | |
| 42 | + | <Location "/pastebin"> | |
| 43 | + | ProxyPass "http://your_address:8080" | |
| 44 | + | ProxyPassReverse "http://your_address:8080" | |
| 45 | + | ProxyHTMLEnable On | |
| 46 | + | ProxyHTMLDocType "<!DOCTYPE html>" | |
| 47 | + | ProxyHTMLURLMap "/" "/pastebin/" | |
| 48 | + | </Location> | |
| 28 | 49 | ``` | |
| 29 | 50 | ||