# hapi-nuxt

> Nuxt.js plugin for Hapi.js

Latest version **2.2.0** (published 2019-05-13) · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install hapi-nuxt
pnpm add hapi-nuxt
yarn add hapi-nuxt
bun add hapi-nuxt
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.2.0 |
| Published | 2019-05-13 |
| First published | 2017-02-05 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 45 |
| Maintainers | pi0 |

## Links

- npm: https://www.npmjs.com/package/hapi-nuxt
- Repository: https://github.com/nuxt-community/hapi-nuxt
- Homepage: https://github.com/nuxt-community/hapi-nuxt#readme
- Issues: https://github.com/nuxt-community/hapi-nuxt/issues
- npm.io page: https://npm.io/package/hapi-nuxt

## Dependencies (1)

- [esm](https://npm.io/package/esm.md) ^3.2.20

## Recent versions

- 2.2.0 (latest) — 2019-05-13
- 2.1.0 — 2019-03-31
- 2.0.0 — 2019-03-31
- 1.0.1 — 2017-12-20
- 0.6.0 — 2017-08-08
- 0.5.0 — 2017-06-04
- 0.4.0 — 2017-05-31
- 0.3.0 — 2017-03-23
- 0.2.1 — 2017-03-03
- 0.2.0 — 2017-03-03
- 0.1.3 — 2017-02-14
- 0.1.2 — 2017-02-10
- 0.1.1 — 2017-02-05
- 0.1.0 — 2017-02-05

## README

# hapi-nuxt

[![npm](https://img.shields.io/npm/dt/hapi-nuxt.svg?style=flat-square)](https://npmjs.com/package/hapi-nuxt)
[![npm release](https://img.shields.io/npm/v/hapi-nuxt/latest.svg?style=flat-square)](https://npmjs.com/package/hapi-nuxt)
[![CircleCI](https://img.shields.io/circleci/project/github/nuxt-community/hapi-nuxt.svg?style=flat-square)](https://circleci.com/gh/nuxt-community/hapi-nuxt)
[![Codecov](https://img.shields.io/codecov/c/github/nuxt-community/hapi-nuxt.svg?style=flat-square)](https://codecov.io/gh/nuxt-community/hapi-nuxt)
[![Greenkeeper badge](https://img.shields.io/badge/greenkeepr-enabled-green.svg?style=flat-square)](https://greenkeeper.io/)
[![dependencies Status](https://david-dm.org/expressjs/express/status.svg?style=flat-square)](https://david-dm.org/expressjs/express)

> [Nuxt.js](https://nuxtjs.org) plugin for [Hapi.js](https://hapijs.com/)

**IMPORTANT:** This plugin is compatible with Hapi >= 17

## Quick start

Install plugin:

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

Register it on your server:

```js
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.

```js
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

---
_Source: https://npm.io/package/hapi-nuxt · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
