import { DOWNLOAD_TARGET, trackSiteEvent } from "./_shared/stats.js";

export async function onRequestGet(context) {
  await trackSiteEvent(context.env, context.request, "download_click", {
    pagePath: "/download"
  });

  const targetUrl = new URL(DOWNLOAD_TARGET, context.request.url);
  return Response.redirect(targetUrl.toString(), 302);
}
