mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Move on-demand-entries-ping to _next namespace (#1305)
This commit is contained in:
parent
01fa65d4a2
commit
b37431461d
|
@ -5,7 +5,7 @@ import fetch from 'unfetch'
|
|||
|
||||
async function ping () {
|
||||
try {
|
||||
const url = `/on-demand-entries-ping?page=${Router.pathname}`
|
||||
const url = `/_next/on-demand-entries-ping?page=${Router.pathname}`
|
||||
const res = await fetch(url)
|
||||
const payload = await res.json()
|
||||
if (payload.invalid) {
|
||||
|
|
|
@ -103,7 +103,7 @@ export default function onDemandEntryHandler (devMiddleware, compiler, {
|
|||
|
||||
middleware () {
|
||||
return function (req, res, next) {
|
||||
if (!/^\/on-demand-entries-ping/.test(req.url)) return next()
|
||||
if (!/^\/_next\/on-demand-entries-ping/.test(req.url)) return next()
|
||||
|
||||
const { query } = parse(req.url, true)
|
||||
const page = normalizePage(query.page)
|
||||
|
|
Loading…
Reference in a new issue