So I went through a Microsoft online demo on how to do an httpTrigger in Visual Studio Code (language: JavaScript) to upload it to Azure Functions and it was successful. I then started to customize the code so it can do a certain calculation. I got the calculation to be done and I was able to print to console.
Now I'm trying to run it locally so I can pass TWO values to it, but testing it with one. I noticed that in their demo, they were able to use the line:
const name = (req.query.name || (req.body && req.body.name));
where in the body response up top, a default {"name": "Azure"} would present and I sent that value, which came up in their response. Basically, they were able to assign const name with what value was passed in the curly braces with the key value pair {"name": "whateverIputhere"}.
So I decided to try in when running locally, below is the condensed code I am having trouble with:
module.exports = async function (req) {
const var1 = req.query.var1
}
and I've tried passing a parameter in multiple ways. I thought I had to do it as {"var1": "1"} but it would tell me var1 is undefined during the running of the function locally.
Why am I not able to assign it as they did?
Possible clue: There is a sample.dat file that I thought I had to modify to just replace the default entries and it still brings up {"name": "Azure"} as the default entries not sure why.
I am at a loss and would love some help.
I was having an issue only because I was NOT including .query as an option to assign the variable. All other "issues" during the description were quickly gone. Thank you all for looking at this.