seneca-web-adapter-hapi
v1.0.2
Published
seneca-web adapter for hapi
Downloads
3
Readme
Seneca Web Adapter Connect
This is an adapter for seneca-web using hapi.
Installation
A peer dependency has been specified seneca-web
And of course hapi
must be present for this to work at all.
npm install --save hapi
npm install --save seneca-web
npm install --save seneca-web-adapter-hapi
Usage
Please refer to the seneca-web documentation on how to load routes.
You can require this module as the adapter when using the SenecaWeb plugin
const Seneca = require('seneca')
const SenecaWeb = require('seneca-web')
const Hapi = require('hapi')
const seneca = Seneca()
seneca.use(SenecaWeb, {
context: (() => {
const server = new Hapi.Server()
server.connection({port: 4000})
return server
})(),
adapter: require('seneca-web-adapter-hapi')
})
seneca.ready(() => {
const server = seneca.export('web/context')()
server.start()
})