TypeError: res.json is not a function

Because you’re overwriting your res variable in the .then of your rp function:

app.post('/danger', function response(req, res) { //see, "res" here was being overwritten
   ..
   ..
   rp(option).then(function(response) { //change the variable name of "res" to "response" (or "turtles", who cares, just dont overwrite your up most "res")

Leave a Comment

tech