mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
This test has started failing when deployed to hosted environments, but it consistently is passing in `next start` tests. We could retry the on-demand revalidation and the test will pass, but we lose the value in the test. This instead temporarily disables it until it can be investigated upstream. [slack x-ref](https://vercel.slack.com/archives/C04KC8A53T7/p1757108995256419)
18 lines
473 B
JavaScript
18 lines
473 B
JavaScript
export default async function handler(req, res) {
|
|
// WARNING: don't use user input in production
|
|
// make sure to use trusted value for revalidating
|
|
let revalidated = false
|
|
try {
|
|
console.log('API: Called res.revalidate for ', req.query.pathname)
|
|
await res.revalidate(req.query.pathname, {
|
|
unstable_onlyGenerated: !!req.query.onlyGenerated,
|
|
})
|
|
revalidated = true
|
|
} catch (err) {
|
|
console.error(err)
|
|
}
|
|
res.json({
|
|
revalidated,
|
|
})
|
|
}
|