Skip to content

Instantly share code, notes, and snippets.

@minivan
Created January 23, 2025 08:48
Show Gist options
  • Select an option

  • Save minivan/c57e68c713f85fc3d1ab91ff79075061 to your computer and use it in GitHub Desktop.

Select an option

Save minivan/c57e68c713f85fc3d1ab91ff79075061 to your computer and use it in GitHub Desktop.
Netlify Function with params
import type { Config, Context } from "@netlify/functions";
export default async (request: Request, context: Context) => {
const name = context.params.name;
const otherParams = new URL(request.url).searchParams.toString();
return new Response(`hello ${name}! The other params are ${otherParams}`);
};
export const config: Config = {
path: "/functions/params/:name",
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment