netlify-functions
Installation
SKILL.md
Netlify Functions
Modern Syntax
Always use the modern default export + Config pattern. Never use the legacy exports.handler or named handler export.
import type { Context, Config } from "@netlify/functions";
export default async (req: Request, context: Context) => {
return new Response("Hello, world!");
};
export const config: Config = {
path: "/api/hello",
};
The handler receives a standard Web API Request and returns a Response. The second argument is a Netlify Context object.