Documentation Index
Fetch the complete documentation index at: https://docs.prism.byescaleira.com/llms.txt
Use this file to discover all available pages before exploring further.
CORS Middleware
When your API is consumed by a browser app on a different domain, browsers enforce Cross-Origin Resource Sharing (CORS). Prism’sPrismCORSMiddleware handles the OPTIONS preflight requests and response headers automatically.
Quick Setup
Allow All Origins
Production Configuration
Specific Origins
SPA Frontend Pattern
A typical setup when your Swift API serves a React/Vue/Angular frontend:SPA Setup
How It Works
- Preflight: Browser sends
OPTIONSrequest before the real request. CORS middleware responds with allowed origins/methods/headers. - Actual request: Middleware adds
Access-Control-Allow-Originand related headers to the response.