Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions appengine/pubsub/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const messages = [];
const PUBSUB_VERIFICATION_TOKEN = process.env.PUBSUB_VERIFICATION_TOKEN;
const TOPIC = process.env.PUBSUB_TOPIC;

const publisher = pubsub.topic(TOPIC).publisher();
const topic = pubsub.topic(TOPIC);

// [START gae_flex_pubsub_index]
app.get('/', (req, res) => {
Expand All @@ -61,7 +61,7 @@ app.post('/', formBodyParser, async (req, res, next) => {

const data = Buffer.from(req.body.payload);
try {
const messageId = await publisher.publish(data);
const messageId = await topic.publish(data);
res.status(200).send(`Message ${messageId} sent.`);
} catch (error) {
next(error);
Expand Down
2 changes: 1 addition & 1 deletion appengine/pubsub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"test": "repo-tools test app && mocha */*.test.js --timeout=30000 --exit"
},
"dependencies": {
"@google-cloud/pubsub": "^0.22.0",
"@google-cloud/pubsub": "^0.28.0",
"body-parser": "^1.18.3",
"express": "^4.16.3",
"pug": "^2.0.1",
Expand Down