Skip to content

senecajs/seneca-web-adapter-hapi

Repository files navigation

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

About

seneca-web adapter for hapi

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •