Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/ApiGateway/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
"customer-route": {
"ClusterId": "customer-cluster",
"Match": { "Path": "/api/customers/{**catch-all}" },
"Transforms": [{ "PathRemovePrefix": "/api/customers" }]
"Transforms": [
{ "PathRemovePrefix": "/api/customers" },
{ "PathPrefix": "/api/customer" }
]
},
"order-route": {
"ClusterId": "order-cluster",
Comment on lines 24 to 25

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 Other service routes have the same prefix-stripping problem that this PR fixes only for the customer route

This PR adds PathPrefix: /api/customer to fix routing for the customer service, which uses [Route("api/[controller]")] resolving to api/Customer. However, the identity, order, product, and notification routes all have the identical issue: they strip /api/{service} via PathRemovePrefix but never re-add the controller prefix. For example, the order route strips /api/orders so /api/orders/5 becomes /5, which is forwarded to http://order-service:5003/5 — but the OrderController at src/Services/Order/Order.API/Controllers/OrderController.cs:6 expects api/Order/5. The same applies to IdentityController (src/Services/Identity/Identity.API/Controllers/IdentityController.cs:6), ProductController (src/Services/Product/Product.API/Controllers/ProductController.cs:6), and NotificationController (src/Services/Notification/Notification.API/Controllers/NotificationController.cs:9). These are pre-existing issues but this PR establishes the fix pattern — the other routes should likely get the same treatment.

(Refers to lines 24-28)

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed — the other routes (identity, order, product, notification) have the same prefix-stripping gap. This PR is intentionally scoped to only the customer route per the task spec; fixing the others would be a separate follow-up.

Expand Down