Skip to content

Instantly share code, notes, and snippets.

@marcoreni
Created May 4, 2018 09:12
Show Gist options
  • Save marcoreni/825908a980665b9cd87b27a4620a0b89 to your computer and use it in GitHub Desktop.
Save marcoreni/825908a980665b9cd87b27a4620a0b89 to your computer and use it in GitHub Desktop.
chairo-error
const Hapi = require('hapi');
const seneca = require('seneca')();
const server = new Hapi.Server();
(async () => {
// Register plugin
try {
await server.register({ plugin: require('chairo'), options: { seneca } });
// Add a Seneca action
let id = 0;
server.seneca.addAsync({ generate: 'id' }, async message => {
return { id: ++id };
});
} catch (err) {
console.log(err);
}
})();
{
"dependencies": {
"chairo": "^4.0.0",
"hapi": "^17.4.0",
"seneca": "^3.4.3"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment