File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed
packages/runtime/src/templates Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change 1
1
export default async function handler ( req , res ) {
2
2
try {
3
3
await res . revalidate ( '/getStaticProps/with-revalidate/' )
4
+ console . log ( 'Revalidated' , req . url )
4
5
return res . json ( { revalidated : true } )
5
6
} catch ( err ) {
6
7
return res . status ( 500 ) . send ( 'Error revalidating' )
Original file line number Diff line number Diff line change @@ -20,15 +20,13 @@ class NetlifyNextServer extends NextServer {
20
20
21
21
public getRequestHandler ( ) : NodeRequestHandler {
22
22
const handler = super . getRequestHandler ( )
23
- return ( req , res , parsedUrl ) => {
23
+ return async ( req , res , parsedUrl ) => {
24
24
if ( req . headers [ 'x-prerender-revalidate' ] ) {
25
- // if (this.netlifyRevalidateToken) {
26
- throw new Error ( `Test throw` )
27
- // await this.netlifyRevalidate(req.url)
28
- // console.log('Revalidated', req.url)
29
- // } else {
30
- // throw new Error(`Missing revalidate token`)
31
- // }
25
+ if ( this . netlifyRevalidateToken ) {
26
+ await this . netlifyRevalidate ( req . url )
27
+ } else {
28
+ throw new Error ( `Missing revalidate token` )
29
+ }
32
30
}
33
31
return handler ( req , res , parsedUrl )
34
32
}
You can’t perform that action at this time.
0 commit comments