Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mkg20001/hapi-spa-serve
Serve a single-page-app from hapi using inert
https://github.com/mkg20001/hapi-spa-serve
hapi inert serve spa
Last synced: 3 days ago
JSON representation
Serve a single-page-app from hapi using inert
- Host: GitHub
- URL: https://github.com/mkg20001/hapi-spa-serve
- Owner: mkg20001
- Created: 2018-09-22T11:15:32.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-09-22T11:49:23.000Z (over 6 years ago)
- Last Synced: 2025-01-30T23:11:51.834Z (5 days ago)
- Topics: hapi, inert, serve, spa
- Language: JavaScript
- Size: 2.93 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# hapi-spa-serve
Serve a single-page-app from hapi using inert
**NOTE: Requires inert plugin to already be registered**
## Usage
```js
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`