google-cloud-platformgoogle-cloud-pubsubgoogle-cloud-pubsub-emulator

PubSub emulator push subscription pushed empty body


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?


Solution

  • My stupidity.

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

    It's work now.