async function handleRequest(request) {
  const cookie = getCookie(request, Cookie)
  // console.log("cookie: " + cookie)
  const dataset = await getData()
  let resp;

  if (cookie) {
    let url = dataset[cookie]
    // console.log(url)
    resp = await fetch(url)
  }

  else {
    var randnum = Math.random() < 0.5 ? 0 : 1
    let url = dataset[randnum]
    let pg = await fetch(url)
    resp = new Response(pg.body)
    resp.headers.append('Set-Cookie', `yummy_cookie=${randnum}`)
  }
  
  return rewrite.transform(resp)
}
/**
 * Respond with a variant page
 * @param {Request} request
 */
Respond with a variant page
@param {Request} request
Respond with a variant page @param { Request } request
async function handleRequest(request) {
  const cookie = getCookie(request, Cookie)
  const dataset = await getData()
  let resp;
  if (cookie) {
    let url = dataset[cookie]
    resp = await fetch(url)
  }
  else {
    var randnum = Math.random() < 0.5 ? 0 : 1
    let url = dataset[randnum]
    let pg = await fetch(url)
    resp = new Response(pg.body)
    resp.headers.append('Set-Cookie', `yummy_cookie=${randnum}`)
  }
  return rewrite.transform(resp)
}
async function handleRequest ( request ) { const cookie = getCookie ( request , Cookie ) const dataset = await getData ( ) let resp ; if ( cookie ) { let url = dataset [ cookie ] resp = await fetch ( url ) } else { var randnum = Math . random ( ) < 0.5 ? 0 : 1 let url = dataset [ randnum ] let pg = await fetch ( url ) resp = new Response ( pg . body ) resp . headers . append ( 'Set-Cookie' , ` ${ randnum } ` ) } return rewrite . transform ( resp ) }
Respond with a variant page
 @param {Request} request
Respond with a variant page @param { Request } request
// console.log("cookie: " + cookie)
 // console.log(url)
