IMPORTANT: This plugin is only compatible with Hapi >= 17
Install plugin:
yarn add hapi-nuxt # or npm install hapi-nuxt
Register it on your server:
const Hapi = require('hapi')
const nuxtPlugin = require('hapi-nuxt')
await server.register({
plugin: nuxtPlugin
options: {
// plugin options
}
}
- Default:
true
(false
when environment variableNODE_ENV
isproduction
)
Automatically starts a Builder
allow to hot reload on dev. Should be disabled for production.
- Default: current working directory
- Default:
nuxt.config.js
Resolved relative to rootDir
- Default:
false
Use nuxt-edge
instead of nuxt
package if set to true
- Default:
/
baseURL for SSR route handler
- Default:
{ id: 'nuxt.render', auth: false }
Hapi route options for SSR handler
- Default:
*
Hapi route method. (Can be set to GET
for more strict handling)
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
MIT