You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm following codelab instructions to publish a topic in pubsub as below, but an error is returning:
response: { message: 'publisher is not defined', internalCode: undefined } }
at next (/home/google2145703_student/training-data-analyst/courses/developingapps/nodejs/pubsub-languageapi-spanner/start/node_modules/express/lib/router/index.js:275:10
Code:
// Handler for feedback POSTed from the client app
router.post('/feedback/:quiz', (req, res, next) => {
const feedback = req.body;
// TODO: Publish the message into Cloud Pub/Sub
publisher.publishFeedback(feedback).then(() => {
// TODO: Move the statement that returns a message to
// the client app here
res.json('Feedback received');
// END TODO
// TODO: Add a catch
}).catch(err => {
// TODO: There was an error, invoke the next middleware
next(err);
// END TODO
});
// END TODO
});
The text was updated successfully, but these errors were encountered:
I'm following codelab instructions to publish a topic in pubsub as below, but an error is returning:
response: { message: 'publisher is not defined', internalCode: undefined } }
at next (/home/google2145703_student/training-data-analyst/courses/developingapps/nodejs/pubsub-languageapi-spanner/start/node_modules/express/lib/router/index.js:275:10
Code:
// Handler for feedback POSTed from the client app
router.post('/feedback/:quiz', (req, res, next) => {
const feedback = req.body;
// TODO: Publish the message into Cloud Pub/Sub
publisher.publishFeedback(feedback).then(() => {
// TODO: Move the statement that returns a message to
// the client app here
res.json('Feedback received');
// TODO: Add a catch
}).catch(err => {
// TODO: There was an error, invoke the next middleware
next(err);
});
// END TODO
});
The text was updated successfully, but these errors were encountered: