PubSub emulator push subscription pushed empty body

235 Views Asked by At
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?

1

There are 1 best solutions below

1
On BEST ANSWER

My stupidity.

I forgot to add the JSON body-parser in my express server.

It's work now.