0.2.5 • Published 8 years ago

@matthewglover/hapi-wrapper v0.2.5

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

Build Status Coverage Status Dependencies

Hapi Wrapper

What

A Promise-based wrapper around Hapi.

Why

Hapi has a number of hooks for configuring a server, some of which can be asynchronous. Hapi Wrapper uses Promises and simple functions which allow the different configuration steps to be composed together.

Hapi-Wrapper also includes Inert by default when you add routes configured to serve static resources from the ./public folder.

How

To include in your project run:

npm install --save @matthewglover/hapi-wrapper.

To create a server:

const {
  createServer,
  setConnection,
  registerPlugins,
  addRoutes,
  startServer } = require('@matthewglover/hapi-wrapper');

const port = process.env.PORT || 4000;

createServer()
  .then(setConnection({ port }))
  .then(registerPlugins())
  .then(addRoutes())
  .then(startServer)
  .then(server => console.log(`Server running at: ${server.info.uri}`))
  .catch(err => console.log(err));
0.2.5

8 years ago

0.2.4

8 years ago

0.2.3

8 years ago

0.2.2

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago