--- id: fastapi-cors version: "0.0.6" license: MIT license_treatment: permissive maintenance: abandoned --- # fastapi-cors — Simple env support of CORS settings for Fastapi applications License: permissive · Maintenance: abandoned · Downloads: 240.6K/mo ## What it is and what it does fastapi-cors is a thin wrapper around FastAPI's built-in CORS middleware that reads configuration from environment variables instead of requiring programmatic setup. It lets you define allowed origins, methods, headers, and credential support through a .env file, then applies those settings with a single function call. The package includes an optional health-check route that displays the active CORS environment variables. The package is designed for developers who want to manage CORS policy through environment configuration rather than code. It depends on environs to parse and cast environment variables, and fastapi as its target framework. Since the package is abandoned (no updates since July 2023), it receives no maintenance or security updates, making it suitable only for stable, low-risk deployments or as a reference implementation rather than a production dependency. Use it for: - Configure CORS for a FastAPI app using only environment variables, avoiding hardcoded origin lists in code. - Set different CORS policies across development, staging, and production by changing .env files without code changes. - Add a health-check endpoint that reports the active CORS configuration for debugging cross-origin request issues. - Quickly scaffold a FastAPI app with sensible CORS defaults (localhost and localhost:3000 allowed) for local development. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Configures CORS settings for FastAPI applications via environment variables, with optional health-check endpoint. No. The package is abandoned and receives no maintenance. For new projects, use FastAPI's built-in CORSMiddleware directly with environment variable parsing via environs or python-dotenv—you gain the same functionality with active upstream support. For existing projects already using fastapi-cors, migration is straightforward since the underlying FastAPI CORS API is stable. ## Install pip install fastapi-cors uv add fastapi-cors poetry add fastapi-cors ## Installing fastapi-cors Before you install: Low install friction with only two runtime dependencies (environs and fastapi). However, the package is abandoned—last release was 2023-07-12 with no updates since, so expect no maintenance or security patches going forward. License in practice: MIT license is permissive, allowing commercial and private use with minimal restrictions. Quickstart: pip install fastapi-cors from fastapi import FastAPI from fastapi_cors import CORS app = FastAPI() CORS(app) Requires fastapi and environs as runtime dependencies; reads .env file during import. Verify before relying: - Whether the package's defaults (localhost:3000 origins, all methods, credentials enabled) are suitable for production use cases beyond development. - How the health-check endpoint behaves when CORS restrictions are in place and whether it poses any security concerns. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: abandoned - Downloads: 240.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags fastapi cors environment variables, cors configuration fastapi, cross-origin requests fastapi, fastapi cors setup, env-based cors settings, fastapi cors middleware, cors, environment-config [View on SkillFed](https://skillfed.io/packages/fastapi-cors) · [View on PyPI](https://pypi.org/project/fastapi-cors/)