From 519a52813f80b562b4a1852cfa86aa745c8eb4fc Mon Sep 17 00:00:00 2001 From: Ashwin Kumar Sivakumar Date: Tue, 7 Jul 2026 18:15:34 +0530 Subject: [PATCH] fix(jobs): nest jobs router under /api/jobs to match gateway routing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The gateway forwards /api/jobs unmodified to the jobs service, but the service registered its routes at bare /jobs with no prefix — every other service (companies, users) nests under /api/ to match. This made the public job listing endpoint unreachable (404) through the gateway on test111. Co-Authored-By: Claude Sonnet 5 --- apps/jobs/src/main.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/jobs/src/main.rs b/apps/jobs/src/main.rs index 39a7d23..ad288c0 100644 --- a/apps/jobs/src/main.rs +++ b/apps/jobs/src/main.rs @@ -3,7 +3,7 @@ use axum::{ extract::State, http::StatusCode, - routing::{get, post}, + routing::get, Json, Router, }; use serde::{Deserialize, Serialize}; @@ -119,9 +119,12 @@ async fn main() { let app = Router::new() .route("/health", get(health)) - .route("/jobs", get(list_jobs)) - .route("/jobs", post(create_job)) - .route("/jobs/{id}", get(get_job)) + .nest( + "/api/jobs", + Router::new() + .route("/", get(list_jobs).post(create_job)) + .route("/{id}", get(get_job)), + ) .layer(cors) .with_state(state);