Skip to content

cors capability

cors adds CORS middleware to your Go service so browser clients can make cross-origin requests.

  • CORS middleware with configurable origins, methods, and headers

Any Go API consumed directly by a browser from a different origin needs CORS headers. Without them, browsers will block requests. Configure allowed origins tightly in production — avoid wildcard * for authenticated APIs.

Requires: http-api

Terminal window
verikt new my-service --language go --cap http-api,cors
# or add to an existing service:
verikt add cors

http-api

The Chi router foundation required by this capability.

auth-jwt

JWT authentication for securing CORS-enabled APIs.

rate-limiting

Rate limiting to protect your public API endpoints.