mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 23:52:06 +00:00
feature: pass request to render:route hook
This commit is contained in:
parent
1582df149d
commit
28d28cb8c1
@ -31,7 +31,7 @@ module.exports = {
|
||||
page.html = modifyHtml(page.html)
|
||||
},
|
||||
// This hook is called before rendering the html to the browser
|
||||
'render:route': (url, page) => {
|
||||
'render:route': (req, page) => {
|
||||
page.html = modifyHtml(page.html)
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ module.exports = async function nuxtMiddleware(req, res, next) {
|
||||
res.statusCode = 200
|
||||
try {
|
||||
const result = await this.renderRoute(req.url, context)
|
||||
await this.nuxt.callHook('render:route', req.url, result)
|
||||
await this.nuxt.callHook('render:route', req, result)
|
||||
const {
|
||||
html,
|
||||
cspScriptSrcHashes,
|
||||
|
Loading…
Reference in New Issue
Block a user