A pastebin for markdown pages.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Christian Müller 5a89055e1f delete from cache only new blacklist entries 9 years ago
resources jshinted all files 9 years ago
.gitignore Makefile added 10 years ago
.jshintrc jshinted all files 9 years ago
.tern-project jshinted all files 9 years ago
LICENSE LICENSE file added 10 years ago
Makefile Makefile added 10 years ago
README.md standalone running instractions added 10 years ago
api_spec.js jshinted all files 9 years ago
package.json adds API tests 9 years ago
server.js delete from cache only new blacklist entries 9 years ago
storage.js jshinted all files 9 years ago
view.js jshinted all files 9 years ago

README.md

README

About

NoteHub is a free and hassle-free pastebin for one-off markdown publishing and was implemented as a one-app-one-language experiment.

Implementation

NoteHub's implementation aims for ultimate simplicity and performance.

Design

  1. At a request, the server first checks, if a note is already rendered and is present in the LRU cache.
    (a) If yes, it return the rendered HTML code and increases the views counter.
    (b) Otherwise, the note is retrieved from the DB, rendered and put into the LRU cache; the views counter will be increased.
  2. The rendering of note pages: there are HTML file tempates with placeholders, which will be trivially filled with replacements.
  3. The LRU cache holds the rendered HTML for the most popular notes, which makes their access a static O(1) operation without any DB I/O.
  4. The server keeps corresponding models for all notes in the cache for statistics updates. These models are persisted every 5 minutes to the DB.

Installation & Deployment

To run NoteHub as a standalone version, execute:

  1. git clone https://github.com/chmllr/NoteHub.git
  2. npm install
  3. npm start

This starts a NoteHub instance on port 3000.