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 () {
|
async function ping () {
|
||||||
try {
|
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 res = await fetch(url)
|
||||||
const payload = await res.json()
|
const payload = await res.json()
|
||||||
if (payload.invalid) {
|
if (payload.invalid) {
|
||||||
|
|
|
@ -103,7 +103,7 @@ export default function onDemandEntryHandler (devMiddleware, compiler, {
|
||||||
|
|
||||||
middleware () {
|
middleware () {
|
||||||
return function (req, res, next) {
|
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 { query } = parse(req.url, true)
|
||||||
const page = normalizePage(query.page)
|
const page = normalizePage(query.page)
|
||||||
|
|
Loading…
Reference in a new issue