Files
evidencija-rezija/mailgun-webhook/build-image.sh
Knee Cola 7aeea9353d feat: implement MailGun webhook service for logging email events
Implemented a production-ready TypeScript/Express.js service to receive
and log MailGun webhook events (delivered, failed, opened, clicked, etc.).

Key features:
- Webhook endpoint (POST /webhook) with comprehensive event logging
- Full TypeScript type definitions for all MailGun event types
- Prometheus metrics integration for monitoring
- Health check endpoint (GET /ping)
- Comprehensive Jest test suite with 87.76% coverage
- Docker containerization with build scripts

Removed template/example code:
- All SQL/MSSQL dependencies and related code
- Example auth router and middleware
- PRTG metrics support (simplified to Prometheus only)
- Unused middleware (CORS, IP whitelist, request parsing/validation)
- Template documentation (kept only MailGun webhook API spec)

The service is clean, minimal, and focused solely on receiving and
logging MailGun webhook events to the console.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-02 20:56:22 +01:00

30 lines
623 B
Bash
Executable File

#!/bin/bash
if [ "$1" == "" ] ; then
printf "\nYou did not specify the Docker image version to build"
printf "\n\nSyntax:\n\n build-image.sh 1.0.0\n\n"
exit 1
fi
read -p "BUILD: Push new image to registry [y/n]? " -n 1 -r
echo # (optional) move to a new line
PUSH_IMAGE_TO_REPO="$REPLY"
printf "\nBUILD START ...\n\n"
IMAGE_NAME=$(node -p "require('./package.json').name")
IMAGE_VERSION=$1
IMAGE_TAG=$IMAGE_NAME:$IMAGE_VERSION
docker build . -t $IMAGE_TAG
if [[ "$PUSH_IMAGE_TO_REPO" =~ ^[Yy]$ ]]
then
printf "\nPushing image ...\n\n"
docker push $IMAGE_TAG
fi
printf "\nBUILD DONE!\n\n"