2.2.0 • Published 5 years ago

hapi-nuxt v2.2.0

Weekly downloads
225
License
-
Repository
github
Last release
5 years ago

hapi-nuxt

npm npm release CircleCI Codecov Greenkeeper badge dependencies Status

Nuxt.js plugin for Hapi.js

IMPORTANT: This plugin is compatible with Hapi >= 17

Quick start

Install plugin:

yarn add hapi-nuxt # or npm install hapi-nuxt

Register it on your server:

const Hapi = require('@hapi/hapi')
const nuxtPlugin = require('hapi-nuxt')

await server.register({
    plugin: nuxtPlugin
    options: {
        // plugin options
    }
}

Options

dev

  • Default: true (false when environment variable NODE_ENV is production)

Automatically starts a Builder allow to hot reload on dev. Should be disabled for production.

rootDir

  • Default: current working directory

nuxtConfig

  • Default: nuxt.config.js

Resolved relative to rootDir

edge

  • Default: false

Use nuxt-edge instead of nuxt package if set to true

baseURL

  • Default: /

baseURL for SSR route handler

route

  • Default: { id: 'nuxt.render', auth: false }

Hapi route options for SSR handler

routeMethod

  • Default: *

Hapi route method. (Can be set to GET for more strict handling)

Access nuxt and builder instances

This plugin exposes nuxt and builder (for dev only) instances to hapi.

server = new Hapi.Server()

await server.register(HapiNuxt)

// Access to nuxt and builder instances using server.plugins.nuxt
const { nuxt, builder } = server.plugins.nuxt

License

MIT

2.2.0

5 years ago

2.1.0

5 years ago

2.0.0

5 years ago

1.0.1

6 years ago

0.6.0

7 years ago

0.5.0

7 years ago

0.4.0

7 years ago

0.3.0

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago