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 @@ -26,7 +26,10 @@
"product-route": {
"ClusterId": "product-cluster",
"Match": { "Path": "/api/products/{**catch-all}" },
"Transforms": [{ "PathRemovePrefix": "/api/products" }]
"Transforms": [
{ "PathRemovePrefix": "/api/products" },
{ "PathPrefix": "/api/product" }
]
Comment on lines +29 to +32

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 gateway routes have the same prefix mismatch that this PR only fixes for the product route

This PR adds a PathPrefix: "/api/product" transform to the product-route to correctly forward requests to the ProductController at api/Product. However, all other routes have the same structural issue: the gateway strips the prefix (e.g. /api/customers) leaving just the remainder (e.g. /123), but the downstream controllers all use [Route("api/[controller]")] and expect paths like /api/Customer/123. For example, CustomerController at src/Services/Customer/Customer.API/Controllers/CustomerController.cs:6 uses [Route("api/[controller]")], but the gateway's customer-route at src/ApiGateway/appsettings.json:18-19 strips /api/customers and forwards just the remainder without adding back a prefix. The same applies to identity, order, and notification routes. If these routes are expected to work, they likely need similar PathPrefix transforms.

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.

Good observation — the other routes (identity, customer, order, notification) do have the same structural mismatch. However, this PR is intentionally scoped to the product route only per the task requirements. Fixing the other routes would be a separate task.

},
"notification-route": {
"ClusterId": "notification-cluster",
Expand Down