A middleware for the SAP UI5 tooling's ui5-server that enables route-based proxying of HTTP requests to backend servers. Version 1.0.10 is the current stable release, with automated publishes via GitHub Actions. It supports flexible configuration via ui5.yaml, including authentication (basic auth or custom Authorization header), path replacement, and changeOrigin option from http-proxy. It integrates with .env files for secrets, and is commonly used in UI5 development to proxy OData or other backend services. Compared to alternatives like ui5-middleware-simpleproxy, it offers per-route configuration and auth header customization.
npm install ui5-middleware-route-proxyVerified import paths — ran on the pinned version, not inferred.
Shows minimal configuration to proxy /sap requests to a backend with authentication and path replacement.
Add the package to 'ui5.dependencies' array in package.json, and also include it in 'devDependencies'.
Ensure 'compression' middleware is enabled in your UI5 project, or adjust 'afterMiddleware' to an existing middleware like 'serveIndex'.
Either use 'header' or 'user'/'pass', not both in the same path configuration. If using 'header', ensure it's a valid Authorization header value.
Always start the route key with '/' (e.g., '/sap', '/odata').
Double-check .env variable names and ensure they match the values in ui5.yaml. Enclose in quotes if necessary.
Explicitly set 'replacePath' to a string path if you need custom replacement, or set to true for current behavior.
Run 'npm install --save-dev ui5-middleware-route-proxy' and add the package to 'ui5.dependencies' array in package.json.
Create a .env file in the project root, or install dotenv: 'npm install dotenv'.
Ensure 'afterMiddleware' is at the same level as 'name' and 'configuration', not inside 'configuration'.
Check ui5.yaml: each route must be a key under 'configuration' with a 'target' property. Ensure proper YAML indentation.