From 0693e309227733d56d65f326aff7098545002d75 Mon Sep 17 00:00:00 2001 From: Tiago Yamamoto Date: Tue, 23 Dec 2025 23:28:17 -0300 Subject: [PATCH] refactor: rename PORT to BACKEND_PORT and API_HOST to BACKEND_HOST --- backend/.env.example | 38 +++++++++++++++++++------------------- backend/cmd/api/main.go | 4 ++-- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/backend/.env.example b/backend/.env.example index 4e58074..be99c9c 100755 --- a/backend/.env.example +++ b/backend/.env.example @@ -1,30 +1,30 @@ -# Environment variables for GoHorse Jobs Backend +# ============================================================================= +# GoHorse Jobs Backend - Environment Variables +# ============================================================================= -# Database Configuration (preferred: use DATABASE_URL) -DATABASE_URL=postgresql://user:password@localhost:5432/gohorsejobs?sslmode=require +# Database Configuration (use DATABASE_URL format) +DATABASE_URL=postgresql://user:password@localhost:5432/gohorsejobs?sslmode=disable -# Alternative: Individual params (used if DATABASE_URL not set) -# DB_HOST=localhost -# DB_PORT=5432 -# DB_USER=postgres -# DB_PASSWORD=yourpassword -# DB_NAME=gohorsejobs -# DB_SSLMODE=require - -# S3/Object Storage Configuration (Civo S3-compatible) +# ============================================================================= +# S3/Object Storage (Civo S3-compatible) +# ============================================================================= AWS_REGION=nyc1 -AWS_ACCESS_KEY_ID=your-access-key -AWS_SECRET_ACCESS_KEY=your-secret-key +AWS_ACCESS_KEY_ID=your-access-key-id +AWS_SECRET_ACCESS_KEY=your-secret-access-key AWS_ENDPOINT=https://objectstore.nyc1.civo.com S3_BUCKET=your-bucket-name -# JWT Secret (CHANGE IN PRODUCTION!) -JWT_SECRET=your-secret-key-change-this-in-production-use-strong-random-value +# ============================================================================= +# JWT Authentication +# ============================================================================= +JWT_SECRET=change-this-to-a-strong-secret-at-least-32-characters +# ============================================================================= # Server Configuration -PORT=8521 +# ============================================================================= +BACKEND_PORT=8521 +BACKEND_HOST=localhost:8521 ENV=development -API_HOST=localhost:8521 # CORS Origins (comma-separated) CORS_ORIGINS=http://localhost:3000,http://localhost:8963 @@ -36,7 +36,7 @@ CLOUDFLARE_API_TOKEN=your-cloudflare-api-token CLOUDFLARE_ZONE_ID=your-zone-id # ============================================================================= -# cPanel API (for email management) +# cPanel API (for email management) # ============================================================================= CPANEL_HOST=https://cpanel.yourdomain.com:2083 CPANEL_USERNAME=your-cpanel-username diff --git a/backend/cmd/api/main.go b/backend/cmd/api/main.go index 156959a..6e91ad0 100755 --- a/backend/cmd/api/main.go +++ b/backend/cmd/api/main.go @@ -35,7 +35,7 @@ func main() { database.RunMigrations() // Configure Swagger Host dynamically - apiHost := os.Getenv("API_HOST") + apiHost := os.Getenv("BACKEND_HOST") if apiHost == "" { apiHost = "localhost:8521" } @@ -57,7 +57,7 @@ func main() { handler := router.NewRouter() - port := os.Getenv("PORT") + port := os.Getenv("BACKEND_PORT") if port == "" { port = "8521" }