Created
November 6, 2015 17:08
-
-
Save monkbroc/93f348c8048ae4b89890 to your computer and use it in GitHub Desktop.
Button dashboard code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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