Netlify Functions Reach for the modern default-handler API ( TypeScript). Export a default async handler taking a web and a Netlify , returning a web . Avoid the legacy AWS Lambda handler shape unless writing Go or migrating old code (see Legacy at the end). File locations - Default directory: (relative to base directory). Keep it outside your publish directory or source files ship as static assets. - A function is one file or a subdirectory whose entry file is named or matches the subdirectory name. All of these create a function : - - - - Use (TS) / (JS) for ES modules. / force CommonJS; /…