Can somebody help me out. Why is the querystring striked through? My code: [![querystring problem][1]][1]
const handler = async (event, context) => {
// Only allow POST
if (event.httpMethod !== "POST") {
return { statusCode: 405, body: "Method Not Allowed" };
}
// When the method is POST, the name will no longer be in the event’s
// queryStringParameters – it’ll be in the event body encoded as a query string
const params = querystring.parse(event.body);
console.log(params);
const { firstname, lastname, country } = params;
// maak er een object van dat de data terugstuurt naar de user
const userData = {
firstname,
lastname,
country
}
return {
statusCode: 200,
body: JSON.stringify(userData),
};
};
module.exports = {handler};
In Vscode it shows up as this: [1]: https://i.stack.imgur.com/lhX7G.png
I copied the code straight from Netlify. 2 [https://functions.netlify.com/playground/#hello%2C-%7Bname%7D-(post-version)]
How can I solve this?