diff --git a/frontend/.env.example b/frontend/.env.example index 0a59413..613bd7f 100644 --- a/frontend/.env.example +++ b/frontend/.env.example @@ -1,29 +1,20 @@ # ============================================================================= -# GoHorse Jobs Frontend - Environment Variables Example +# GoHorse Jobs Frontend - Environment Variables # ============================================================================= # Copy this file to .env.local and update the values -# API Backend URL -# IMPORTANT: Include /api/v1 suffix -# Local development: -NEXT_PUBLIC_API_URL=http://localhost:8521/api/v1 +# API Backend URL (just the domain, endpoints already include /api/v1) +# Examples: +# Local development: http://localhost:8521 +# Production: https://api.gohorsejobs.com -# Production: -# NEXT_PUBLIC_API_URL=https://api-dev.gohorsejobs.com/api/v1 +NEXT_PUBLIC_API_URL=http://localhost:8521 # Seeder API URL (for admin operations) NEXT_PUBLIC_SEEDER_API_URL=http://localhost:3001 -# Production: -# NEXT_PUBLIC_SEEDER_API_URL=https://seeder-dev.gohorsejobs.com - # Scraper API URL (for importing scraped jobs) NEXT_PUBLIC_SCRAPER_API_URL=http://localhost:3002 -# Production: -# NEXT_PUBLIC_SCRAPER_API_URL=https://scraper-dev.gohorsejobs.com - # Vercel Analytics (optional) NEXT_PUBLIC_VERCEL_ANALYTICS=false - - diff --git a/frontend/src/lib/api.ts b/frontend/src/lib/api.ts index 8c66528..2c7d7ad 100644 --- a/frontend/src/lib/api.ts +++ b/frontend/src/lib/api.ts @@ -1,8 +1,9 @@ import { toast } from "sonner"; import { Job } from "./types"; -// const API_BASE_URL = "http://localhost:8521"; // Backend URL // Use this for dev -const API_BASE_URL = ""; // Use this for production/setup with proxy +// API Base URL - endpoints already include /api/v1 prefix +// NEXT_PUBLIC_API_URL should be just the domain, e.g. https://api.gohorsejobs.com +const API_BASE_URL = process.env.NEXT_PUBLIC_API_URL || ""; /** * Helper to log CRUD actions for the 'Activity Log' or console