export interface GeoApiResponse {
  country: string;
  continent: string;
  city: string;
}

export const onRequest: PagesFunction = async ({ request }) =>
  new Response(
    JSON.stringify({
      // @ts-ignore
      country: request.cf.country,
      // @ts-ignore
      continent: request.cf.continent,
      // @ts-ignore
      city: request.cf.city,
    } as GeoApiResponse)
  );
