Architecture

How It Works

A deep dive into how eve-preflight intercepts and validates requests without modifying your Eve project code.

01. Route Discovery via eve info --json

On launch, preflight executes eve info --json in a child process inside your project directory. It parses the resulting JSON payload, extracting every registered channel entry in channels[].urlPath (e.g. /api/channels/web, /api/channels/slack).

// Parsed channel definition
{ "name": "slack", "urlPath": "/api/channels/slack", "type": "webhook" }

02. Transparent Reverse-Proxy Layer

Preflight binds a lightweight Node HTTP reverse-proxy on port 3001 (or PREFLIGHT_PORT) sitting between webhook senders and the local Eve dev instance on port 3000. Every incoming byte, header, and chunk is streamed transparently to ensure 100% request fidelity.

03. Match vs. No-Match Behavior

On Match

The request path strictly matches a registered channel urlPath. Preflight logs a match audit entry and forwards the stream directly to Eve:

✓ [MATCH] POST /api/channels/slack (200 OK)
On No Match (Silent Failure Trap)

The request lands on an unmapped endpoint (e.g. /api/slack/events). Preflight intercepts it, prints a high-priority red warning, outputs all valid routes, and explains that Eve will drop it with a silent 404:

⚠ [MISMATCH] POST /api/slack/events → 404

04. Slack Connector Heuristic Check

Preflight inspects incoming HTTP headers for standard Slack signing signatures (x-slack-signature and x-slack-request-timestamp).

If a Slack request arrives at an unmapped path (like /webhook or /slack/events), preflight explicitly flags:

[SLACK CONNECTOR MISCONFIGURATION DETECTED]
Slack request detected via x-slack-signature header, but sent to /slack/events.
Your registered Slack channel is served at: /api/channels/slack.