Created
January 23, 2025 08:48
-
-
Save minivan/c57e68c713f85fc3d1ab91ff79075061 to your computer and use it in GitHub Desktop.
Netlify Function with params
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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