Docs / CORS

CORS

Per-origin CORS configuration in hopak.config.ts.

Off by default. Enable per-origin:

// hopak.config.ts
import { defineConfig } from '@hopak/core';

export default defineConfig({
  cors: {
    origins: ['https://myapp.com', 'http://localhost:5173'],
    credentials: true,
  },
});

Or wildcard:

cors: { origins: '*' }

OPTIONS preflight is handled automatically.