Getting req.param undefined
param is a function, not an object. So you need to use req.param('email');
req.params
Refers to the variables in your route path.
app.get("/posts/:id", ...
// => req.params.id
Post data can be referenced through req.body
app.post("/posts", ...
// => req.body.email
This assumes you are using the bodyParser
middleware.
And then there is req.query
, for those ?query=strings
.
You can use req.param()
for either of the 3 above. The look up order is params
, body
, query
.