Commit 8b97d27
committed
infra: add ALLOW_ORIGIN_REGEX for Vercel preview deploy CORS (OPE-56)
Vercel preview deploys get dynamic URLs like:
opencodeintel-git-feat-xxx.vercel.app
These need to call the Railway backend but get CORS blocked because
ALLOWED_ORIGINS only has the production domain.
FastAPI CORSMiddleware supports allow_origin_regex -- now configurable
via ALLOW_ORIGIN_REGEX env var. Set on Railway to:
https://.*\.vercel\.app
This allows all Vercel preview URLs to call the backend while keeping
the explicit ALLOWED_ORIGINS list for production.
Also added GITHUB_TOKEN to optional startup vars (used by /repos/analyze).1 parent ef30258 commit 8b97d27
3 files changed
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
43 | 46 | | |
44 | 47 | | |
45 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
78 | 81 | | |
79 | 82 | | |
80 | 83 | | |
| 84 | + | |
81 | 85 | | |
82 | 86 | | |
83 | 87 | | |
| |||
0 commit comments