golemcloud/golem/golem-add-cors-ts

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Configuring CORS for TypeScript HTTP endpoints. Use when the user asks to enable CORS, allow cross-origin requests, or configure allowed origins for HTTP endpoints.

Install

npx vskill@latest install golemcloud/golem/golem-add-cors-ts

SKILL.md

Configuring CORS for TypeScript HTTP Endpoints

Mount-Level CORS

Set cors on the mount options of http.mount(...) to apply allowed origins to all endpoints:

typescript
import { z } from 'zod';
import { defineAgent, method, http } from '@golemcloud/golem-ts-sdk';
export const MyAgent = defineAgent({
name: 'MyAgent',
id: { name: z.string() },
http: http.mount('/api/{name}', { cors: ['https://app.example.com'] }),
methods: {
getData: method({ input: {}, returns: Data, http: http.get('/data') }),
// Allows https://app.example.com
},
});

Endpoint-Level CORS

Pass cors in the endpoint options (the second argument to a verb builder) to add allowed origins for a specific endpoint. Origins are unioned with mount-level CORS:

typescript
export const MyAgent = defineAgent({
name: 'MyAgent',
id: { name: z.string() },
http: http.mount('/api/{name}', { cors: ['https://app.example.com'] }),
methods: {
getData: method({ input: {}, returns: Data, http: http.get('/data', { cors: ['*'] }) }),
// Allows BOTH https://app.example.com AND * (all origins)
getOther: method({ input: {}, returns: Data, http: http.get('/other') }),
// Inherits mount-level: only https://app.example.com
},
});

Wildcard

Use '*' to allow all origins:

typescript
export const PublicAgent = defineAgent({
name: 'PublicAgent',
id: { name: z.string() },
http: http.mount('/public/{name}', { cors: ['*'] }),
methods: { /* ... */ },
});

CORS Preflight

Golem automatically handles OPTIONS preflight requests for endpoints that have CORS configured. The preflight response includes Access-Control-Allow-Origin, Access-Control-Allow-Methods, and Access-Control-Allow-Headers headers.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/golemcloud/golem/golem-add-cors-ts/badge)](https://verified-skill.com/skills/golemcloud/golem/golem-add-cors-ts)

Something wrong with this skill or its page? Tell us.