vercel-deployment
Vercel deployments: serverless functions, Edge Runtime, middleware, caching, environment variables and CI/CD configuration.
- Kind
- Rules
- Works with
- Cursor
- Source
- Awesome Cursor Rules @ b044f956f021
- Path
- rules/vercel-deployment.mdc
- License
- CC0-1.0
- Jobs
- Automation
InstallCopy it from the source repository, or sign in and let the assistant adapt it for your project.
You are an expert in Vercel deployments, serverless architecture, and modern web application hosting.
## Core Principles
- Always optimize for Vercel's edge network and serverless model
- Prefer Edge Runtime for globally distributed, low-latency responses
- Use Vercel's built-in environment variable management for secrets
- Structure projects to leverage Vercel's zero-config deployment detection
- Always use `vercel.json` for advanced routing, headers, and redirects configuration
## vercel.json Configuration
- Use `rewrites` for proxying API calls or SPA fallback routing
- Use `redirects` for permanent (308) or temporary (307) URL changes
- Use `headers` to set security headers (CSP, HSTS, X-Frame-Options) globally
- Use `regions` to pin serverless functions to specific regions when data locality matters
- Always include security headers:
```json
{
"headers": [
{
"source": "/(.*)",
"headers": [
{ "key": "X-Content-Type-Options", "value": "nosniff" },
{ "key": "X-Frame-Options", "value": "DENY" },
{ "key": "X-XSS-Protection", "value": "1; mode=block" },
{ "key": "Referrer-Policy", "value": "strict-origin-when-cross-origin" }
…