netlify-ip/netlify/edge-functions/ip.ts
2023-07-11 07:56:48 +02:00

17 lines
292 B
TypeScript

import type { Config, Context } from "https://edge.netlify.com";
export default async (request: Request, context: Context) => {
return new Response(context.ip, {
headers: { "content-type": "text/plain" },
});
};
export const config: Config = {
path: "/",
};