Skip to content

Instantly share code, notes, and snippets.

@krusynth
Created December 8, 2014 21:56
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 krusynth/a96a3dfa26f4fa48ee4d to your computer and use it in GitHub Desktop.
Save krusynth/a96a3dfa26f4fa48ee4d to your computer and use it in GitHub Desktop.
Sails.js Controller using etherpad-lite-client
var etherpad_client = require('etherpad-lite-client');
module.exports = {
/**
* list() - list all docs
*/
list: function(req, res) {
etherpad_api = etherpad_client.connect({
apikey: sails.config.connections.etherpad.apikey,
host: sails.config.connections.etherpad.host,
port: sails.config.connections.etherpad.port
});
etherpad_api.listAllPads(function(error, results) {
if(!error) {
res.send(results);
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment