NodeJS (ExpressJS) Unhandled rejection TypeError: callback is not a function NodeJS (ExpressJS) Unhandled rejection TypeError: callback is not a function express express

NodeJS (ExpressJS) Unhandled rejection TypeError: callback is not a function


The correct Syntax is

        Test.addResponse(obj, (result) => {        }); 

it's working:


Test.addResponse((obj,result) => {})

Looks like you're giving your callback as the first parameter (instead of response). It should be 2nd.

You probably wanted to do:

Test.addResponse(res, (obj,result) => {})