Reputation: 2069
const subscription = topic.subscription("subscription");
const [exists] = await subscription.exists();
if (exists) {
await subscription.delete();
}
await subscription.create({
pushConfig: {
pushEndpoint: `http://localhost:${PORT}`
},
});
I've set up the subscription and it's triggered to my HTTP server.
But without any body data. Does anyone have an idea here?
Upvotes: 0
Views: 274
Reputation: 2069
My stupidity.
I forgot to add the JSON body-parser in my express server.
It's work now.
Upvotes: 2