I got the following error when trying to run my app Error: Route.get() requires a callback function but got a [object Object]
I have this error because of this:
app.get( "/data",
request('https://www.googleapis.com/analytics/v3/management/accounts?access_token=xxxxxxx'),
function (error, response, body) {
console.log('error:', error); // Print the error if one occurred
console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received
console.log('body:', body);
})
I'm passing the token with a middleware but I've just hardcoded it for the example.
What does this error mean? Is this something expected by the Google API?