mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +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)
|
page.html = modifyHtml(page.html)
|
||||||
},
|
},
|
||||||
// This hook is called before rendering the html to the browser
|
// This hook is called before rendering the html to the browser
|
||||||
'render:route': (url, page) => {
|
'render:route': (req, page) => {
|
||||||
page.html = modifyHtml(page.html)
|
page.html = modifyHtml(page.html)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ module.exports = async function nuxtMiddleware(req, res, next) {
|
|||||||
res.statusCode = 200
|
res.statusCode = 200
|
||||||
try {
|
try {
|
||||||
const result = await this.renderRoute(req.url, context)
|
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 {
|
const {
|
||||||
html,
|
html,
|
||||||
cspScriptSrcHashes,
|
cspScriptSrcHashes,
|
||||||
|
Loading…
Reference in New Issue
Block a user