Create a standalone Bun HTTP server that can accept external requests for redaction. This allows tools like Tampermonkey scripts or internal dashboards to utilize the redaction engine programmatically.
Architecture:
- Standalone Bun HTTP server in
packages/api/
- Works on-prem and can be deployed to Vercel
- No Next.js - pure Bun native HTTP
Requirements:
- Endpoint: POST /api/redact
- Payload: JSON object
{ text: string, config?: object, preset?: string }
- Response: JSON object
{ redactedText: string, stats: {...}, mapping: {...} }
- CORS: Must be configured to allow requests from external origins (for browser scripts)
Tasks:
Create a standalone Bun HTTP server that can accept external requests for redaction. This allows tools like Tampermonkey scripts or internal dashboards to utilize the redaction engine programmatically.
Architecture:
packages/api/Requirements:
{ text: string, config?: object, preset?: string }{ redactedText: string, stats: {...}, mapping: {...} }Tasks:
packages/api/server.tswith Bun.serve()bun apiscript to package.json