File size: 426 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import * as React from 'react'
import { cookies } from 'next/headers'

if (!('hot' in Math)) Math.hot = false

export default function page() {
  // make the page dynamic
  cookies()
  const previous = Math.hot
  Math.hot = true

  // crash the server after responding
  if (process.env.CRASH_FUNCTION) {
    setTimeout(() => {
      throw new Error('crash')
    }, 500)
  }

  return <div>{previous ? 'HOT' : 'COLD'}</div>
}