diff --git a/.gitignore b/.gitignore
index e653c91..ed50308 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,14 +1,6 @@
-Makefile
-PrivateMakefile
dump.rdb
-resources/public/cljs
-pom.xml
-*jar
-/lib/
-/classes/
-.lein-*
-.crossover-cljs
-target/
-.nrepl-port
-.idea/
-NoteHub.iml
+bin/
+node_modules/
+npm-debug.log
+database.sqlite
+database.sqlite-journal
diff --git a/.vscode/launch.json b/.vscode/launch.json
new file mode 100644
index 0000000..c71297c
--- /dev/null
+++ b/.vscode/launch.json
@@ -0,0 +1,42 @@
+{
+ "version": "0.1.0",
+ // List of configurations. Add new configurations or edit existing ones.
+ // ONLY "node" and "mono" are supported, change "type" to switch.
+ "configurations": [
+ {
+ // Name of configuration; appears in the launch configuration drop down menu.
+ "name": "Launch storage.js",
+ // Type of configuration. Possible values: "node", "mono".
+ "type": "node",
+ // Workspace relative or absolute path to the program.
+ "program": "bin/storage.js",
+ // Automatically stop program after launch.
+ "stopOnEntry": false,
+ // Command line arguments passed to the program.
+ "args": [],
+ // Workspace relative or absolute path to the working directory of the program being debugged. Default is the current workspace.
+ "cwd": ".",
+ // Workspace relative or absolute path to the runtime executable to be used. Default is the runtime executable on the PATH.
+ "runtimeExecutable": null,
+ // Optional arguments passed to the runtime executable.
+ "runtimeArgs": ["--nolazy"],
+ // Environment variables passed to the program.
+ "env": {
+ "NODE_ENV": "development"
+ },
+ // Use JavaScript source maps (if they exist).
+ "sourceMaps": false,
+ // If JavaScript source maps are enabled, the generated code is expected in this directory.
+ "outDir": null
+ },
+ {
+ "name": "Attach",
+ "type": "node",
+ // TCP/IP address. Default is "localhost".
+ "address": "localhost",
+ // Port to attach to.
+ "port": 5858,
+ "sourceMaps": false
+ }
+ ]
+}
diff --git a/API.md b/API.md
deleted file mode 100644
index fad729a..0000000
--- a/API.md
+++ /dev/null
@@ -1,147 +0,0 @@
-# NoteHub API
-
-**Version 1.4, status: released.**
-
-## Changelog
-
-- **V1.4**: Bugfix: no whitespace elimination from the note text is needed now for the signature computation.
-- **V1.3**: New note ID format.
-- **V1.2**: Theme & font settings can be specified during the publishing.
-- **V1.1**: Fields `publisher` and `title` in the response to the note retrieval.
-- **V1.0**: Initial release.
-
-## Prerequisites
-
-The NoteHub API can only be used in combination with a __Publisher ID__ (PID) and __Publisher Secret Key__ (PSK), which can be requested [here](#registration). The PSK can be revoked at any moment in case of an API abuse.
-
-A PID is a string chosen by the publisher and cannot be longer than 16 characters (e.g.: __notepadPlugin__). A PSK will be generated by the NoteHub API and can be a string of any length and content.
-
-All API requests must be issued with one special parameter `version` denoting the expected version of the API as a string, e.g. `1.0` (see examples below). You should always put the version of this document as a `version` parameter.
-
-Once you obtained your PSK, you can test the API [here](/api-test.html).
-
-## NoteHub API Access Request
-To register as a publisher and gain access to NoteHub API, please send an email with the following information about you: the desired PID, your contact information, a short description of what you want to do and an URL of the resource where the API will be used or its website.
-
-## Note Retrieval
-
-A simple `GET` request to the following URL:
-
- https://www.notehub.org/api/note
-
-with the following parameters:
-
-Parameter | Explanation | Type
---- | --- | ---
-`noteID` | Note-ID | **required**
-`version` | Used API version | **required**
-
-will return a JSON object containing following self explaining fields: `note`, `title`, `longURL`, `shortURL`, `statistics`, `status`, `publisher`.
-
-Example:
-
- {
- note: "markdown source",
- title: "Lorem Ipsum.",
- longURL: "https://www.notehub.org/2014/1/3/lorem-ipsum",
- shortURL: "https://www.notehub.org/0vrcp",
- statistics: {
- published: "1396250865735",
- edited: "1412516289863",
- views: 24
- },
- status: {
- success: true,
- comment: "some server message"
- },
- publisher: "Publisher Description"
- }
-
-Hence, the status of the request can be evaluated by reading of the property `status.success`. The field `status.comment`might contain an error message, a warning or any other comments from the server.
-
-The note ID is a string, containing the date of publishing and a few first words of the note (usually the title), e.g.: `"2014/1/3/lorem-ipsum"`. This ID will be generated by NoteHub automatically.
-
-## Note Publishing
-
-A note must be created by a `POST` request to the following URL:
-
- https://www.notehub.org/api/note
-
-with the following parameters:
-
-Parameter | Explanation | Type
---- | --- | ---
-`note` | Text to publish | **required**
-`pid` | Publisher ID | **required**
-`signature` | Signature | **required**
-`password` | Secret token (plain or hashed) | *optional*
-`version` | Used API version | **required**
-`theme` | Theme name | *optional*
-`text-size` | Text size | *optional*
-`header-size`| Header size | *optional*
-`text-font` | Text font name | *optional*
-`header-font`| Header font name | *optional*
-
-The Signature is the MD5 hash of the following string concatenation:
-
- pid + psk + note
-
-The signature serves as a proof, that the request is authentic and will be issued by the publisher corresponding to the provided PID. Please note, that _all_ of the values used in the signature computation, should be identical to the values passed with the request itself.
-Ensure, that your note contains only `\n` symbols as line breaks!
-
-The parameters specifying the theme name and fonts are optional and only impact the URLs returned back.
-
-The response of the server will contain the fields `noteID`, `longURL`, `shortURL`, `status`.
-
-Example:
-
- {
- noteID: "2014/1/3/lorem-ipsum",
- longURL: "https://www.notehub.org/2014/1/3/lorem-ipsum",
- shortURL: "https://www.notehub.org/0vrcp",
- status: {
- success: true,
- comment: "some server message"
- }
- }
-
-The status object serves the same purpose as in the case of note retrieval.
-
-## Note Update
-
-To update a note, an `PUT` request must be issued to the following URL:
-
- https://www.notehub.org/api/note
-
-with the following parameters:
-
-Parameter | Explanation | Type
---- | --- | ---
-`noteID` | Note-ID | **required**
-`note` | New text | **required**
-`pid` | Publisher ID | **required**
-`signature` | Signature | **required**
-`password` | Secret token (plain or hashed) | **required**
-`version` | Used API version | **required**
-
-The Signature is the MD5 hash of the following string concatenation:
-
- pid + psk + noteID + note + password
-
-Please note, that all of the values used in the signature computation, should be identical to the values passed with the request itself.
-Ensure, that your note contains only `\n` symbols as line breaks!
-
-The response of the server will contain the fields `longURL`, `shortURL`, `status`.
-
-Example:
-
- {
- longURL: "https://www.notehub.org/2014/1/3/lorem-ipsum",
- shortURL: "https://www.notehub.org/0vrcp",
- status: {
- success: true,
- comment: "some server message"
- }
- }
-
-The status object serves the same purpose as in the case of note retrieval and publishing.
diff --git a/LANDING.md b/LANDING.md
deleted file mode 100644
index 7a148a5..0000000
--- a/LANDING.md
+++ /dev/null
@@ -1,19 +0,0 @@
-## Features
-- **Themes**: specify the color scheme in the URL: [default](/2014/3/31/demo-note), [dark](/2014/3/31/demo-note?theme=dark), [solarized light](/2014/3/31/demo-note?theme=solarized-light), [solarized dark](/2014/3/31/demo-note?theme=solarized-dark).
-- **Fonts**: specify a font (e.g., [Google Web Fonts](http://www.google.com/webfonts/)) for headers and body text in the URL like [this](/8m4l9) or [this](/2014/3/31/demo-note?text-font=monospace&header-font=Courier&text-size=0.7&header-size=1.1).
-- **Short URLs**: every page (including theme & font options) has its own short url.
-- **Editing**: if you set a password during publishing, you can edit your note any time later.
-- **Statistics**: page view counter, publishing and editing date.
-- **Expiration**: all notes with less than 30 views after the first 30 days will expire.
-- **Export**: the original markdown content can be displayed in plain text format.
-- **API**: Integrate the publishing functionality into your editor using the official [NoteHub API](/api).
-
-## Changelog
- - **2014-09**: text size setting added ([example](/2014/3/31/demo-note?text-font=monospace&header-font=Courier&text-size=0.7&header-size=1.1))
- - **2014-07**: deprecated all API versions less than 1.4 & performance improvements.
- - **2014-03**: note expiration implemented.
- - **2014-02**: a simple JS-client for API testing [added](/api-test.html).
- - **2014-01**: [NoteHub API](/api), mobile friendly styling and more.
- - **2013-03**: new color themes.
- - **2012-07**: password protection for note editing added.
- - **2012-06**: NoteHub released as a result of an [experiment](/2012/6/16/how-notehub-is-built).
diff --git a/Procfile b/Procfile
deleted file mode 100644
index 0fef382..0000000
--- a/Procfile
+++ /dev/null
@@ -1 +0,0 @@
-web: lein with-profile production ring server-headless $PORT
diff --git a/README.md b/README.md
index 1f80f77..d3a9c06 100644
--- a/README.md
+++ b/README.md
@@ -2,14 +2,8 @@
[NoteHub](https://www.notehub.org) is a free and hassle-free pastebin for one-off markdown publishing.
-NoteHub _was_ an one-app-one-language [experiment](https://www.notehub.org/2012/6/16/how-notehub-is-built) and was initially implemented entirely in [Clojure](http://clojure.org) (ClojureScript).
-NoteHub's persistence layer is based on the key-value store [redis](http://redis.io).
-Currently, NoteHub is hosted for free on [Heroku](http://heroku.com).
-
-NoteHub supports an [API](https://github.com/chmllr/NoteHub/blob/master/API.md) and can be integrated as a publishing platform.
-
## How to Use?
-First, create [a new page](https://www.notehub.org/new) using the [Markdown syntax](http://daringfireball.net/projects/markdown/).
+First, create [a new page](https://notehub.org/new) using the [Markdown syntax](http://daringfireball.net/projects/markdown/).
When the note is published, you'll see a subtle panel at the bottom of the screen.
From this panel you can go to a rudimentary statistics of the article, or you can export the original markdown, or copy the short url of the note.
Besides this, you also can invert the color scheme by appending to the note url:
diff --git a/jsconfig.json b/jsconfig.json
new file mode 100644
index 0000000..ca5b5e3
--- /dev/null
+++ b/jsconfig.json
@@ -0,0 +1,10 @@
+{
+ "compilerOptions": {
+ "target": "ES6",
+ "module": "commonjs"
+ },
+ "exclude": [
+ "node_modules",
+ "bin"
+ ]
+}
diff --git a/messages b/messages
deleted file mode 100644
index 30b460b..0000000
--- a/messages
+++ /dev/null
@@ -1,28 +0,0 @@
-page-title = Free Pastebin for One-Off Markdown Publishing
-title = Free and Hassle-free Pastebin for Markdown Pages.
-name = NoteHub
-new-page = New Page
-
-status-404 = Not Found
-status-400 = Bad Request
-status-403 = Forbidden
-status-500 = Internal Server Error
-
-footer = Source code on [GitHub](https://github.com/chmllr/NoteHub) · Hosted on [Heroku](http://heroku.com) · DB on [RedisLabs](http://redislabs.com) · SSL by [CloudFlare](http://cloudflare.com) Created by [@chmllr](https://github.com/chmllr)
-
-loading = Loading...
-set-passwd = Password for editing
-enter-passwd = Password
-publish = Publish
-update = Save
-published = Published
-publisher = Publisher
-edited = Edited
-views = Article Views
-statistics = Statistics
-stats = statistics
-export = export
-notehub = ⌂ notehub
-edit = edit
-short-url = short url
-api-title = API
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..4e582e4
--- /dev/null
+++ b/package.json
@@ -0,0 +1,34 @@
+{
+ "name": "NoteHub",
+ "version": "3.0.0",
+ "description": "Free Pastebin for One-Off Markdown Publishing",
+ "main": "server.js",
+ "scripts": {
+ "server": "node server.js",
+ "devser": "nodemon server.js",
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/chmllr/NoteHub.git"
+ },
+ "keywords": [
+ "markdown",
+ "pastebin"
+ ],
+ "author": "Christian Müller (http://github.com/chmllr)",
+ "license": "ISC",
+ "bugs": {
+ "url": "https://github.com/chmllr/NoteHub/issues"
+ },
+ "homepage": "https://github.com/chmllr/NoteHub",
+ "dependencies": {
+ "body-parser": "^1.14.1",
+ "express": "^4.13.3",
+ "lru-cache": "^2.6.5",
+ "marked": "^0.3.5",
+ "md5": "^2.0.0",
+ "sequelize": "^3.8.0",
+ "sqlite3": "^3.1.0"
+ }
+}
diff --git a/project.clj b/project.clj
deleted file mode 100644
index 42b4412..0000000
--- a/project.clj
+++ /dev/null
@@ -1,26 +0,0 @@
-(defproject NoteHub "2.0.0"
- :description "A free and anonymous hosting for markdown pages."
- :dependencies [[org.clojure/clojure "1.6.0"]
- [org.clojure/core.cache "0.6.4"]
- [hiccup "1.0.5"]
- [zeus "0.1.0"]
- [garden "1.2.5"]
- [org.pegdown/pegdown "1.4.2"]
- [iokv "0.1.1"]
- [cheshire "5.3.1"]
- [ring "1.3.1"]
- [com.taoensso/carmine "2.7.0" :exclusions [org.clojure/clojure]]
- [compojure "1.2.0"]]
- :main notehub.handler
- :min-lein-version "2.0.0"
- :plugins [[lein-ring "0.8.12"]]
- :ring {:handler notehub.handler/app}
- :profiles {:uberjar {:aot :all}
- :production {:ring {:auto-reload? false
- :auto-refresh? false}}
- :dev {:ring {:auto-reload? true
- :auto-refresh? true}
- :dependencies
- [[javax.servlet/servlet-api "2.5"]
- [ring-mock "0.1.5"]]}}
- :jvm-opts ["-Dfile.encoding=utf-8"])
diff --git a/resources/edit.html b/resources/edit.html
new file mode 100644
index 0000000..37a049d
--- /dev/null
+++ b/resources/edit.html
@@ -0,0 +1,35 @@
+
+
+
+
+ NoteHub — New Page
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/resources/footer.html b/resources/footer.html
new file mode 100644
index 0000000..b98b195
--- /dev/null
+++ b/resources/footer.html
@@ -0,0 +1,6 @@
+
\ No newline at end of file
diff --git a/resources/public/api-test.html b/resources/public/api-test.html
deleted file mode 100644
index d87222d..0000000
--- a/resources/public/api-test.html
+++ /dev/null
@@ -1,121 +0,0 @@
-
-
-
-
-
-NoteHub API Testing
-
-
-
-
-