Skip to content

Commit

Permalink
feat: routeMethod and change default to * (fixes #16)
Browse files Browse the repository at this point in the history
  • Loading branch information
pooya parsa committed Mar 31, 2019
1 parent a7b9e0e commit 93c63a6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ baseURL for SSR route handler
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.
Expand Down
3 changes: 2 additions & 1 deletion lib/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ exports.register = async function nuxtPlugin(server, _config) {
edge: false,
baseURL: null,
route: {},
routeMethod: '*',
..._config
}

Expand Down Expand Up @@ -41,7 +42,7 @@ exports.register = async function nuxtPlugin(server, _config) {

// Route handler
server.route({
method: 'GET',
method: config.routeMethod,
path: config.baseURL ? `/${config.baseURL}/{path*}`.replace('//', '/') : '/{path*}',
config: {
id: 'nuxt.render',
Expand Down

0 comments on commit 93c63a6

Please sign in to comment.