fix(jobs): nest jobs router under /api/jobs to match gateway routing

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/<service> to match.
This made the public job listing endpoint unreachable (404) through
the gateway on test111.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Ashwin Kumar Sivakumar 2026-07-07 18:15:34 +05:30
parent afb4dc9ae6
commit 519a52813f

View file

@ -3,7 +3,7 @@
use axum::{ use axum::{
extract::State, extract::State,
http::StatusCode, http::StatusCode,
routing::{get, post}, routing::get,
Json, Router, Json, Router,
}; };
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
@ -119,9 +119,12 @@ async fn main() {
let app = Router::new() let app = Router::new()
.route("/health", get(health)) .route("/health", get(health))
.route("/jobs", get(list_jobs)) .nest(
.route("/jobs", post(create_job)) "/api/jobs",
.route("/jobs/{id}", get(get_job)) Router::new()
.route("/", get(list_jobs).post(create_job))
.route("/{id}", get(get_job)),
)
.layer(cors) .layer(cors)
.with_state(state); .with_state(state);