JSPM

hapi-spa-serve

0.1.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7
  • Score
    100M100P100Q30077F
  • License MIT

Serve a single-page-app from hapi using inert

Package Exports

  • hapi-spa-serve

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hapi-spa-serve) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

hapi-spa-serve

Serve a single-page-app from hapi using inert

NOTE: Requires inert plugin to already be registered

Usage

const SPA = require('hapi-spa-serve')
const path = require('path')

SPA(server, {assets: path.join(__dirname, 'assets'), path: '/app'})

In case you're using an auth startegy you might want to set options to { auth: {mode: 'optional'} }

API

  • assets: String Absolute path to assets
  • path: String Optional path to serve the app, default: /
  • options: Object Optional options to add to the routes, default: null