refactor: rename PORT to BACKEND_PORT and API_HOST to BACKEND_HOST

This commit is contained in:
Tiago Yamamoto 2025-12-23 23:28:17 -03:00
parent 924255fdfb
commit 0693e30922
2 changed files with 21 additions and 21 deletions

View file

@ -1,30 +1,30 @@
# Environment variables for GoHorse Jobs Backend # =============================================================================
# GoHorse Jobs Backend - Environment Variables
# =============================================================================
# Database Configuration (preferred: use DATABASE_URL) # Database Configuration (use DATABASE_URL format)
DATABASE_URL=postgresql://user:password@localhost:5432/gohorsejobs?sslmode=require DATABASE_URL=postgresql://user:password@localhost:5432/gohorsejobs?sslmode=disable
# Alternative: Individual params (used if DATABASE_URL not set) # =============================================================================
# DB_HOST=localhost # S3/Object Storage (Civo S3-compatible)
# DB_PORT=5432 # =============================================================================
# DB_USER=postgres
# DB_PASSWORD=yourpassword
# DB_NAME=gohorsejobs
# DB_SSLMODE=require
# S3/Object Storage Configuration (Civo S3-compatible)
AWS_REGION=nyc1 AWS_REGION=nyc1
AWS_ACCESS_KEY_ID=your-access-key AWS_ACCESS_KEY_ID=your-access-key-id
AWS_SECRET_ACCESS_KEY=your-secret-key AWS_SECRET_ACCESS_KEY=your-secret-access-key
AWS_ENDPOINT=https://objectstore.nyc1.civo.com AWS_ENDPOINT=https://objectstore.nyc1.civo.com
S3_BUCKET=your-bucket-name 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 # Server Configuration
PORT=8521 # =============================================================================
BACKEND_PORT=8521
BACKEND_HOST=localhost:8521
ENV=development ENV=development
API_HOST=localhost:8521
# CORS Origins (comma-separated) # CORS Origins (comma-separated)
CORS_ORIGINS=http://localhost:3000,http://localhost:8963 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 CLOUDFLARE_ZONE_ID=your-zone-id
# ============================================================================= # =============================================================================
# cPanel API (for email management) # cPanel API (for email management)
# ============================================================================= # =============================================================================
CPANEL_HOST=https://cpanel.yourdomain.com:2083 CPANEL_HOST=https://cpanel.yourdomain.com:2083
CPANEL_USERNAME=your-cpanel-username CPANEL_USERNAME=your-cpanel-username

View file

@ -35,7 +35,7 @@ func main() {
database.RunMigrations() database.RunMigrations()
// Configure Swagger Host dynamically // Configure Swagger Host dynamically
apiHost := os.Getenv("API_HOST") apiHost := os.Getenv("BACKEND_HOST")
if apiHost == "" { if apiHost == "" {
apiHost = "localhost:8521" apiHost = "localhost:8521"
} }
@ -57,7 +57,7 @@ func main() {
handler := router.NewRouter() handler := router.NewRouter()
port := os.Getenv("PORT") port := os.Getenv("BACKEND_PORT")
if port == "" { if port == "" {
port = "8521" port = "8521"
} }