← back to Koroseal Quote Only
backend/route-wiring.md
46 lines
# Backend wiring — `/api/quote-request`
The Liquid snippet posts to `https://api.designerwallcoverings.com/api/quote-request`.
This route reuses the existing Koroseal quote API infrastructure (George email +
nginx `/api` proxy already deployed by the commercial-quote skill). Two options:
## Option A (recommended) — add the route to the existing Koroseal quote API
On Kamatera, in the existing quote-API server (the one already answering
`/api/koroseal-quote`), add:
```js
const { handleQuoteRequest } = require('./quote-request-handler');
app.post('/api/quote-request', handleQuoteRequest);
```
Keep the legacy `/api/koroseal-quote` route as-is (the Koroseal section still uses it).
The nginx `location /api/` proxy → `127.0.0.1:<port>` already forwards this path, so
no nginx change is needed if the block is a prefix match. If nginx pins the exact
`location /api/koroseal-quote`, add a sibling:
```nginx
location /api/quote-request {
proxy_pass http://127.0.0.1:3001;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
}
```
Then `pm2 restart <quote-api> --update-env`.
## Option B — standalone mini-server
If the Koroseal API project isn't present, `server.js` here stands up the single
route on its own pm2 process behind the same nginx `/api` proxy.
## Env (see .env.example)
- `GEORGE_EMAIL_URL` — George send endpoint (Mac2 over Tailscale, e.g. `http://100.65.187.120:9850/api/send`)
- `INFO_EMAIL` — `info@designerwallcoverings.com`
- `DEALER_DISCOUNT` — badge text (default `15% Designer / Trade Discount`)
## George send-gate note (george-reject-canary class)
George's anti-exfil send-gate blocks a site emailing its OWN `info@<own-domain>`
if that recipient isn't on George's internal allowlist. `info@designerwallcoverings.com`
IS the canonical DW inbox and should already be allowlisted (Koroseal uses it), but
VERIFY before go-live by sending one test quote and confirming it lands (not "external
send blocked"). This is exactly the failure class the `george-reject-canary` watches.