Configuration

Environment variables

VariableRequiredDescription
PORTNoServer port (default: 8080)
FIREBASE_CREDENTIALS_PATHNoPath to Firebase service account JSON (local)
FIREBASE_CREDENTIALS_JSONNoFull Firebase credentials JSON string (Vercel)
UPSTASH_REDIS_REST_URLNoUpstash Redis REST URL (for cache)
UPSTASH_REDIS_REST_TOKENNoUpstash Redis REST token

.env file

cp .env.example .env

Then edit .env and fill in your values.

gofire setup questions

QuestionDefaultDescription
Server port8080Local server port
Firebase credentials JSON path(empty)Service account JSON path; leave empty to disable auth
Enable Redis cache (Upstash)?ny or n
Upstash Redis REST URLIf Redis enabled, e.g. https://your-db.upstash.io
Upstash Redis REST TokenIf Redis enabled
Save configuration to .env?nWrite answers to .env
Create .gofire.yaml with custom output paths?nIf 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.