seneca-web-adapter-hapi

1.0.2 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i seneca-web-adapter-hapi

Weekly Downloads

4

Version

1.0.2

License

MIT

Last publish

Collaborators

  • davidmarkclements
  • mcdonnelldean
  • mihaidma
  • rjrodger
  • tswaters
  • wyatt