golem-add-cors-ts

Configure CORS on TypeScript HTTP endpoints with mount and route origins.

Updated May 17, 2026
One-click install
npx skills add https://github.com/Rust-soham/golem-claw --skill golem-add-cors-ts-rust-soham
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golem-add-cors-ts
Source: https://github.com/Rust-soham/golem-claw/tree/main/packages/golem/.agents/skills/golem-add-cors-ts
Command: npx skills add https://github.com/Rust-soham/golem-claw --skill golem-add-cors-ts-rust-soham

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Cross-origin browser requests fail when your TypeScript HTTP endpoints don’t return the correct CORS headers, forcing teams to manually debug front-end integration issues.

Core Features & Use Cases

  • Mount-level CORS: Set allowed origins once on the @agent() mount so all endpoints under that mount inherit the configuration.
  • Endpoint-level CORS: Override or extend CORS at the @endpoint() level, with endpoint origins unioned with mount-level origins.
  • Wildcard support: Allow all origins using *, including for public endpoints meant to be consumed broadly.
  • Automatic preflight handling: The Skill covers CORS preflight by responding to OPTIONS requests with the required Access-Control-Allow-* headers.

Quick Start

Configure CORS by setting the cors property on @agent() for all routes or on @endpoint() for specific routes, including optional wildcard support with '*'.

Frequently Asked Questions about golem-add-cors-ts

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add CORS headers to TypeScript HTTP endpoints?

To fix blocked cross-origin browser requests, configure allowed origins on the @agent() mount for all routes or @endpoint() for specific paths. This automatically resolves CORS errors by returning the correct Access-Control-Allow-Origin header.

How does preflight OPTIONS request handling work for cross-origin API configuration?

Preflight OPTIONS requests are handled automatically by responding with the required Access-Control-Allow-Methods and Access-Control-Allow-Headers. This mechanism ensures browsers validate cross-origin API permissions before executing the actual HTTP request.

Can I set different allowed origins for specific routes in my TypeScript API?

Yes, you can set endpoint-level CORS using @endpoint(), which unions those origins with mount-level @agent() origins. This allows specific GET/OPTIONS routes to have different cross-origin permissions than the global mount.

Does this CORS configuration support wildcard origins for public APIs?

Yes, wildcard '*' is supported for broadly consumed public endpoints. You can apply the wildcard at the @agent() mount or @endpoint() level to allow all origins to access your TypeScript HTTP endpoints.

What's the best way to apply API configuration for cross-origin requests across an entire mount?

The best way to apply cross-origin API configuration across a mount is setting the cors property once on @agent(). All HTTP endpoints under that mount automatically inherit the allowed origins and preflight responses.