Created
May 4, 2018 09:12
-
-
Save marcoreni/825908a980665b9cd87b27a4620a0b89 to your computer and use it in GitHub Desktop.
chairo-error
This file contains hidden or 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
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); | |
} | |
})(); |
This file contains hidden or 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
{ | |
"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