Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nuxtjs/hapi

Package Overview
Dependencies
Maintainers
6
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nuxtjs/hapi

Nuxt.js plugin for Hapi.js

  • 2.3.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
59
decreased by-31.4%
Maintainers
6
Weekly downloads
 
Created
Source

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

Setup

  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
  }
}

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.

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.

Development

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

License

MIT License

Copyright (c) Nuxt Community

FAQs

Package last updated on 13 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc