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:
parent
afb4dc9ae6
commit
519a52813f
1 changed files with 7 additions and 4 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue