The file name where the lambda handler is written is called bar.js.
I want to be able type mywebsite.com/foo/bar, and the handler in the bar.js file runs.
I call fetch(.netlify/functions/bar?product=${foo}
) when I type in mywebsite.com/foo/bar. The issue here is that ‘foo’ could be any word and it is not something I can predict. So I want ‘foo’ to be variable so I can’t just create the file foo.js for my lambda function.
I am not sure how to correctly make this work. Thanks!