Skip to content

Instantly share code, notes, and snippets.

@monkbroc
Created November 6, 2015 17:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save monkbroc/93f348c8048ae4b89890 to your computer and use it in GitHub Desktop.
Save monkbroc/93f348c8048ae4b89890 to your computer and use it in GitHub Desktop.
Button dashboard code
module['exports'] = function dashboard (hook) {
function get(key, callback) {
var datastore = hook.datastore;
datastore.get(key, function (err, counter) {
callback(counter || 0);
});
}
get('counter', function (counter) {
hook.res.end(counter);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment