Phone/LAN testing previously required editing both app.ts (cors origin) and auth.ts (better-auth trustedOrigins). Now both read env.WEB_ORIGINS, parsed from a comma-separated CORS_ORIGINS env var (default http://localhost:5173). To test from a phone, set CORS_ORIGINS to include the LAN origin and restart the API — no code edit. Documented in .env.example. Also fixed the worker README (db:migrate creates ./data/app.db, not ./.tmp; phone step now uses CORS_ORIGINS). API tests 36/36 green; typecheck clean.
10 lines
395 B
Plaintext
10 lines
395 B
Plaintext
DATABASE_URL=file:./data/app.db
|
|
BETTER_AUTH_SECRET=change-me-to-a-long-random-string
|
|
BETTER_AUTH_URL=http://localhost:3000
|
|
PORT=3000
|
|
|
|
# Comma-separated browser origins allowed for CORS + better-auth (the worker SPA).
|
|
# Add your phone's LAN origin to test on a device — no code edit needed, e.g.:
|
|
# CORS_ORIGINS=http://localhost:5173,http://192.168.1.50:5173
|
|
CORS_ORIGINS=http://localhost:5173
|