CorsOptions class final

CORS settings for GenkitRouter.serve and GenkitRouter.handleHttpRequest.

await genkit.serve(
  cors: const CorsOptions(allowedOrigins: ['https://myapp.dev']),
);

Constructors

CorsOptions({List<String> allowedOrigins = const ['*'], List<String> allowedHeaders = const ['Content-Type', 'Authorization'], List<String> exposedHeaders = const ['x-genkit-trace-id', 'x-genkit-span-id']})
const

Properties

allowedHeaders → List<String>
Request headers browsers may send (Access-Control-Allow-Headers).
final
allowedOrigins → List<String>
Origins allowed to call the server, e.g. https://myapp.dev.
final
exposedHeaders → List<String>
Response headers browser code may read (Access-Control-Expose-Headers).
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited