cors-gen

Generate CORS settings for Express, Next.js, and nginx stacks.

1|Updated Jan 30, 2026
One-click install
npx skills add https://github.com/jieni777/opencode-config-backup --skill cors-gen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cors-gen
Source: https://github.com/jieni777/opencode-config-backup/tree/main/skills/cors-gen
Command: npx skills add https://github.com/jieni777/opencode-config-backup --skill cors-gen

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Generate CORS configurations for your stack to resolve cross-origin request issues and ensure secure API access.

Core Features & Use Cases

  • Generates framework-specific CORS settings for common stacks (Express, Next.js, nginx, etc.)
  • Handles multi-origin setups and complex deployment scenarios
  • Enforces best practices for allowed origins, methods, headers, credentials, and preflight caching

Quick Start

Describe your stack and run the tool to generate a ready-to-use CORS configuration.

Frequently Asked Questions about cors-gen

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

FAQPage Schema
How do I configure CORS for multiple origins in Express and nginx?

To configure CORS for multiple origins, you define allowed origins, methods, and headers in your Express app or nginx server block. This generates ready-to-use CORS settings handling multi-origin setups and preflight behavior securely.

What is the best way to set up cross-origin configuration for Next.js API routes?

The best way to set up cross-origin configuration for Next.js API routes is applying framework-specific CORS settings. This enforces best practices for allowed origins, credentials handling, and preflight caching tailored to your stack.

Does this cross-origin configuration approach support credentials and custom headers?

Yes, this cross-origin configuration approach supports credentials and custom headers. It specifically satisfies the generation of allowed headers and credentials handling to ensure secure cross-origin API access across different deployment environments.

How do I generate CORS settings for complex deployment scenarios with multiple environments?

To generate CORS settings for multiple environments, describe your stack and target architecture. It produces tailored configurations for complex deployment scenarios, handling allowed origins and preflight behavior for secure cross-origin API access.

Why does my nginx CORS preflight request fail with multiple origins?

Your nginx CORS preflight request might fail because allowed origins, methods, or headers are misconfigured for multi-origin deployments. It resolves this by generating ready-to-use nginx settings enforcing preflight behavior and cross-origin security best practices.