Files
calendar/apps/web/pages/api/countrycode.ts
T
aa0a1fcc95 upgrade nextjs to 13.2 version and replace @next/font for in built ne… (#7440)
* upgrade nextjs to 13.2 version and replace @next/font for in built next/font

* Sync packages

* Update yarn.lock

* Updates edge configs

---------

Co-authored-by: zomars <zomars@me.com>
2023-02-28 16:38:46 -07:00

21 lines
401 B
TypeScript

import type { NextRequest } from "next/server";
export const config = {
runtime: "edge",
};
export default async function handler(req: NextRequest) {
const countryCode = req.headers.get("x-vercel-ip-country") ?? "";
return new Response(
JSON.stringify({
countryCode,
}),
{
status: 200,
headers: {
"content-type": "application/json",
},
}
);
}