npm.io
0.5.13 • Published 5 years ago

@goldpage/hapi

Licence
—
Version
0.5.13
Deps
3
Size
10 kB
Vulns
0
Weekly
0
Stars
57

Goldpage + Hapi =

@goldpage/hapi

Use Goldpage with Hapi.

Usage

Install @goldpage/hapi.

$ npm install @goldpage/hapi

The plugin is automatically loaded and a Hapi plugin is now available at require('goldpage').hapi.

Example

// ./example/server.js

const Hapi = require('hapi');
const ssr = require('goldpage');

startServer();

async function startServer() {
  const server = Hapi.Server({
    port: process.env.PORT || 3000,
    debug: {request: ['internal']},
  });

  await server.register(ssr.hapi);

  await server.start();

  console.log('Server running');
}