Nuxt.js plugin for Hapi.js
Last updated 2 months ago by pi0 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @nuxtjs/hapi 
SYNC missed versions from official npm registry.

Hapi Plugin for Nuxt.js

npm version npm downloads Circle CI Codecov License

Nuxt.js plugin for Hapi.js

IMPORTANT: This plugin is compatible with Hapi >= 17


  1. Add @nuxtjs/hapi dependency to your project
yarn add @nuxtjs/hapi # or npm install @nuxtjs/hapi
  1. Register it on your server:
const Hapi = require('@hapi/hapi')
const nuxtPlugin = require('@nuxtjs/hapi')

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



  • 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.


Override nuxt.config


  • Default: current working directory

Nuxt app 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)

Access nuxt and builder instances

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

const server = new Hapi.Server()

await server.register(HapiNuxt)

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

Access Hapi's internals.

The hapi request object is available from nuxtServerInit and the context under res.hapi. Likewise, the hapi response toolkit will be available in res.hapi.


  1. Clone this repository
  2. Install dependencies using yarn install or npm install
  3. Start development server using npm run dev


MIT License

Copyright (c) Nuxt Community

Current Tags

  • 3.0.0                                ...           latest (2 months ago)

3 Versions

  • 3.0.0                                ...           2 months ago
  • 2.3.0                                ...           a year ago
  • 2.2.1                                ...           a year ago
Today 0
This Week 0
This Month 10
Last Day 0
Last Week 3
Last Month 31
Dependencies (0)
Dev Dependencies (10)
Dependents (0)

Copyright 2014 - 2016 © taobao.org |