diff --git a/README.md b/README.md index a3cb0ff..a7135ed 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/lib/plugin.js b/lib/plugin.js index 6b0c277..bb0519f 100755 --- a/lib/plugin.js +++ b/lib/plugin.js @@ -11,6 +11,7 @@ exports.register = async function nuxtPlugin(server, _config) { edge: false, baseURL: null, route: {}, + routeMethod: '*', ..._config } @@ -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',