netlify-ip/netlify/edge-functions/ip.ts

18 lines
292 B
TypeScript
Raw Permalink Normal View History

2023-07-11 07:56:48 +02:00
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: "/",
};