A free Pastebin-like service which wants to to be as minimal (regarding UI, UX and speed) as it can get, without compromising any features or usability.
JavaScript HTML CSS
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
public
.gitignore
README.md
ansi.js
config.yaml
database.js
download.js
index.js
migrate.js
package.json
qbin.js
server.js
spam.js
upload.js

README.md

qbin

  ████████  
████    ██  qbin
██      ██  
██      ██  minimal pastebin
██████████ 

Features

  • POST API with CORS
  • Telnet API (like termbin.com)
  • Caching - files are served with Cache Control header, the public HTML is served from the RAM according to the If-Modified-Since header.
  • Compression - although the actual files aren't currently served with GZIP, the public HTML is served GZIPped, minified and provides file inclusion to minimize the count of HTTP requests.
  • More features and a more detailed HTTP API documentation can be found on the about/api page.

Setup

$ git clone https://github.com/moqmar/qbin2.git
$ cd qbin
$ npm i -g  # Install globally
$ qbin      # Start the server

API

URLs

https://qbin.io/ -> public/*        Frontend (Public HTML)
https://qbin.io/                    Default POST endpoint
https://qbin.io/<filename>          Uploaded files
  filename = Default: 7-9 lowercase characters or digits (e.g. gh0ldm2b)
https://qbin.io/<filename>/raw      Uploaded files in a raw format

API Usage

Netcat

$ echo "Hello World" | nc qbin.io 9999
https://qbin.io/bghj7sfb

CURL

$ echo "Hello World" | curl -FQ=@- qbin.io

POST via jQuery

$.post("https://qbin.io", "Hello World", console.log.bind(console));

POST via fetch()

(function(t){fetch("https://qbin.io",{method:"POST",body:t}).then(r=>r.text()).then(l=>console.log(l))})("Hello World")

Templates

Include other files

Other files can be included by using /*#@include filename.txt */, which is always relative to public.
The config file can be included by using /*#@config*/.

IF-FIRSTREQUEST

Code in syntax.html which is contained in <IF-FIRSTREQUEST>...</IF-FIRSTREQUEST> will only be shown directly after the page was uploaded.