0

I'm having a problem assigning variables in express.I switched over to using post from get and I'm using bodyParser as middleware.

Here's the JSON I get from the browser in node when I execute

console.log(req.body)

{ 'params[chartPID]': '12' }

I want to assign the JSON above to a variable. I've tried using req.body.params[chartPID] and many other patterns, but the variable is always undefined.

What am I doing wrong? How can I get the value of params[chartPID] ?

Thank you for your help!

Harsh Jain
  • 135
  • 11

0 Answers0