Fix: Configure quarkus.http.root-path for proper Swagger UI routing
- Added quarkus.http.root-path=/btpxpress in production config - Removed custom Swagger UI files (index.html, swagger-initializer.js) - Backend now knows it's served under /btpxpress context path - Swagger UI will correctly generate URLs like /btpxpress/openapi IMPORTANT: Ingress configuration must be updated to NOT use rewrite-target The Ingress should pass requests to backend with full path preserved: https://api.lions.dev/btpxpress/openapi -> http://backend:8080/btpxpress/openapi This is the proper solution instead of using rewrite-target which breaks context-aware applications like Swagger UI.
This commit is contained in:
@@ -1,15 +0,0 @@
|
|||||||
window.onload = function() {
|
|
||||||
window.ui = SwaggerUIBundle({
|
|
||||||
url: "/btpxpress/openapi",
|
|
||||||
dom_id: '#swagger-ui',
|
|
||||||
deepLinking: true,
|
|
||||||
presets: [
|
|
||||||
SwaggerUIBundle.presets.apis,
|
|
||||||
SwaggerUIStandalonePreset
|
|
||||||
],
|
|
||||||
plugins: [
|
|
||||||
SwaggerUIBundle.plugins.DownloadUrl
|
|
||||||
],
|
|
||||||
layout: "StandaloneLayout"
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -19,7 +19,9 @@ quarkus.hibernate-orm.log.bind-parameters=false
|
|||||||
# Serveur HTTP
|
# Serveur HTTP
|
||||||
quarkus.http.port=${SERVER_PORT:8080}
|
quarkus.http.port=${SERVER_PORT:8080}
|
||||||
quarkus.http.host=0.0.0.0
|
quarkus.http.host=0.0.0.0
|
||||||
# Note: root-path removed - Ingress handles /btpxpress routing with rewrite-target
|
quarkus.http.root-path=/btpxpress
|
||||||
|
# Note: Backend is aware of the /btpxpress context path
|
||||||
|
# Ingress should NOT use rewrite-target to preserve the full path
|
||||||
|
|
||||||
# CORS Configuration pour production
|
# CORS Configuration pour production
|
||||||
quarkus.http.cors=true
|
quarkus.http.cors=true
|
||||||
|
|||||||
Reference in New Issue
Block a user