{"id":18885,"library":"ui5-middleware-index","title":"ui5-middleware-index","description":"UI5 middleware for @ui5/cli that delivers a custom welcome/start page (e.g., index_peter.html) instead of a directory listing when the root path is requested. Version 3.1.3 is the latest stable, with monthly releases. Requires @ui5/cli@^3.0.0 and specVersion: \"3.0\" in ui5.yaml. Key differentiator: lightweight, community-maintained alternative to custom server configuration for SAP UI5 projects.","status":"active","version":"3.1.3","language":"javascript","source_language":"en","source_url":"https://github.com/ui5-community/ui5-ecosystem-showcase","tags":["javascript"],"install":[{"cmd":"npm install ui5-middleware-index","lang":"bash","label":"npm"},{"cmd":"yarn add ui5-middleware-index","lang":"bash","label":"yarn"},{"cmd":"pnpm add ui5-middleware-index","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required middleware runtime; must be version >=3.0.0","package":"@ui5/cli","optional":true}],"imports":[{"note":"Configuration goes in ui5.yaml under server.customMiddleware. The name is used directly; no import in JavaScript code. Define as devDependency in package.json.","wrong":"\n  - name: ui5-middleware-index\n    path: ./node_modules/ui5-middleware-index\n","symbol":"ui5-middleware-index","correct":"\n  - name: ui5-middleware-index\n    afterMiddleware: compression\n    configuration:\n      welcomeFile: \"index_peter.html\"\n"},{"note":"Should be a devDependency, not a production dependency.","wrong":"npm install ui5-middleware-index --save","symbol":"devDependency","correct":"npm install ui5-middleware-index --save-dev"},{"note":"The 'index' option is deprecated since v3; use 'welcomeFile' instead.","wrong":"index: \"index_peter.html\"","symbol":"welcomeFile configuration","correct":"welcomeFile: \"index_peter.html\""}],"quickstart":{"code":"// 1. Install\nnpm install ui5-middleware-index --save-dev\n\n// 2. Add to ui5.yaml:\n// server:\n//   customMiddleware:\n//   - name: ui5-middleware-index\n//     afterMiddleware: compression\n//     configuration:\n//       welcomeFile: \"index_peter.html\"\n\n// 3. Create index_peter.html in your app root\n// 4. Run: ui5 serve\n// Access http://localhost:8080/ -> serves index_peter.html","lang":"yaml","description":"Installs middleware and configures ui5.yaml to serve a custom welcome file instead of directory listing."},"warnings":[{"fix":"Update @ui5/cli to version >=3.0.0 and set specVersion: \"3.0\" in your ui5.yaml.","message":"Version 3.x requires @ui5/cli >=3.0.0 and specVersion: \"3.0\" in ui5.yaml. Older @ui5/cli versions are incompatible.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Use 'welcomeFile' instead.","message":"The 'index' configuration option is deprecated and will be removed in future versions.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Ensure URL ends with '/' or configure your browser to add trailing slash.","message":"The middleware only triggers when requesting the root path '/' with a trailing slash. Omitting the trailing slash may not redirect.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Set 'afterMiddleware: compression' in the middleware configuration.","message":"The middleware must be listed after 'compression' in ui5.yaml to work correctly.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"npm install @ui5/cli@latest --save-dev","cause":"Using @ui5/cli version below 3.0.0 with this middleware v3.","error":"Middleware 'ui5-middleware-index' is not supported by the current UI5 CLI version. Please update @ui5/cli to >=3.0.0."},{"fix":"npm install ui5-middleware-index --save-dev","cause":"Missing npm install or not listed in package.json devDependencies.","error":"Failed to load middleware: Cannot find module 'ui5-middleware-index'"},{"fix":"Replace 'index' with 'welcomeFile' in the middleware configuration.","cause":"Using deprecated 'index' option in ui5.yaml.","error":"Configuration error: Unknown option 'index'. Use 'welcomeFile' instead."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}