diff --git a/cmd/gateway/main.go b/cmd/gateway/main.go index 7ab93f5..28089aa 100644 --- a/cmd/gateway/main.go +++ b/cmd/gateway/main.go @@ -203,8 +203,14 @@ func main() { router.Use(middleware.Logger) router.Use(middleware.Recoverer) + // CORS Configuration - Allow frontend origins + // In production, replace with actual frontend domain(s) via environment variable router.Use(cors.New(cors.Options{ - AllowedOrigins: []string{"http://localhost:3000", "https://techtorque.vercel.app"}, + AllowedOrigins: []string{ + "http://localhost:3000", + "http://127.0.0.1:3000", + "https://techtorque.vercel.app", + }, AllowedMethods: []string{"GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"}, AllowedHeaders: []string{"Accept", "Authorization", "Content-Type", "X-CSRF-Token"}, ExposedHeaders: []string{"Link"}, diff --git a/config.yaml b/config.yaml index fe442b5..4c841d8 100644 --- a/config.yaml +++ b/config.yaml @@ -45,6 +45,13 @@ services: auth_required: true # env_var not specified - will auto-generate: APPOINTMENTS_SERVICE_URL + # Service Types (also handled by Appointment Service) + - name: "service-types" + path_prefix: "/api/v1/service-types" + target_url: "http://localhost:8083" + strip_prefix: "/api/v1" + auth_required: true + # --- Service & Project Management Service (Port 8084) --- - name: "services" path_prefix: "/api/v1/services"