1.0.2 • Published 8 years ago

seneca-web-adapter-hapi v1.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

Seneca Web Adapter Connect

Build Status Coverage Status

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()
})
1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago