Skip to content

Webhook — def-exsport-webhook

A small Express app that receives third-party callbacks and republishes each one to an SNS topic. It is the inbound fan-out side of the integrations.

How this page was verified

Read on 2026-09-15 from index.js and package.json. Local checkout: /Volumes/xpro/erisristemena/nodejs/def-exsport-webhook.

Stack

Express 5.1, plain JavaScript (index.js, no TypeScript), aws-sdk 2, axios, dotenv. Node ≥ 20. Scripts: start = node index.js, dev = nodemon index.js. Port from APP_PORT (default 3000). Has a Dockerfile. Single-branch: main only — commit straight on it, and it still auto-deploys on push (deploy/prod.sh).

What it does

Routes are prefixed by APP_PREFIX if set. GET / and a GET on each callback path return ok (health). Three inbound POST callbacks, each republished to a distinct SNS topic via SNS.publish:

CallbackRouteSNS topic env
WMS / stockPOST /inventorySNS_TOPIC_WMS_ARN
BiteshipPOST /deliverySNS_TOPIC_DELIVERY_ARN
DOKUPOST /paymentSNS_TOPIC_PAYMENT_ARN

Each handler logs headers and body, then publishes Message: JSON.stringify(req.body). AWS is configured from AWS_REGION, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY.

The SNS topics and their subscriptions are defined in the Pulumi webhook stack. See Third parties for how these callbacks reach the backend's webhooks/* handlers.