Parameter Usages
FaasPlus makes it easy to use query string values as parameters, allowing for dynamic responses based on user input
Example 1: Say Hello
In this example, we’ll greet you by the first name and last name provided in the query string parameter.
export async function handler(event) {
const firstName = event.params?.firstName || 'John';
const lastName = event.params?.lastName || 'Doe';
return {
Hello: firstName + ' ' + lastName
};
}
Response
{
"Hello": "Alan Turing"
}
You can also check filtering section to use parameter in filtering