Configuration
Environment variables
| Variable | Required | Description |
|---|---|---|
PORT | No | Server port (default: 8080) |
FIREBASE_CREDENTIALS_PATH | No | Path to Firebase service account JSON (local) |
FIREBASE_CREDENTIALS_JSON | No | Full Firebase credentials JSON string (Vercel) |
UPSTASH_REDIS_REST_URL | No | Upstash Redis REST URL (for cache) |
UPSTASH_REDIS_REST_TOKEN | No | Upstash Redis REST token |
.env file
cp .env.example .env
Then edit .env and fill in your values.
gofire setup questions
| Question | Default | Description |
|---|---|---|
| Server port | 8080 | Local server port |
| Firebase credentials JSON path | (empty) | Service account JSON path; leave empty to disable auth |
| Enable Redis cache (Upstash)? | n | y or n |
| Upstash Redis REST URL | — | If Redis enabled, e.g. https://your-db.upstash.io |
| Upstash Redis REST Token | — | If Redis enabled |
| Save configuration to .env? | n | Write answers to .env |
| Create .gofire.yaml with custom output paths? | n | If y, prompts for server and handlers directories (e.g. pkg/server, pkg/handler) |
.gofire.yaml
During gofire setup you can choose to create .gofire.yaml with custom serverDir and handlersDir. Then gofire gen uses these paths without flags. See Custom layouts.