From ad59f788dc2417e4bb5ce5861deb693f2ef3888c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Chopin?= Date: Mon, 30 Oct 2017 23:15:06 +0100 Subject: [PATCH] hook: Add render:route hook --- lib/core/renderer.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/core/renderer.js b/lib/core/renderer.js index 6c09c18001..f9d0209e4d 100644 --- a/lib/core/renderer.js +++ b/lib/core/renderer.js @@ -283,7 +283,10 @@ export default class Renderer { res.statusCode = 200 try { - const { html, error, redirected, resourceHints } = await this.renderRoute(req.url, context) + const result = await this.renderRoute(req.url, context) + await this.nuxt.callHook('render:route', req.url, result) + const { html, error, redirected, resourceHints } = result + if (redirected) { return html }