Build toolBuild tooltypeRuns at build time. Nothing of it ships in the deployed application.See every one →What this type is →by a community orgby a community orgoriginPublished by a community organisation, so it outlives any one maintainer.See every one →

ui5-middleware-cap

A UI5 CLI middleware that runs a CDS server inside the UI5 dev server, mounted at a path the UI5 project configures, so one command serves the app and its CAP services.

A UI5 CLI project's dev server serves the app, and the CAP services it calls run in a second process started and stopped on its own. This middleware calls cds serve and embeds the express middlewares it returns into the UI5 dev server, so one command answers both: it is entered under server/customMiddleware in ui5.yaml, where mountPath sets the url the CDS server answers on and moduleId names the npm package the CDS server is loaded from. Its default options are with-mocks and in-memory?, which start in-process mock services for required services that have no external binding and add a transient in-memory database bootstrapped on each restart. It is the counterpart of cds-plugin-ui5, which embeds the other way round, the UI5 CLI middlewares inside the CDS server; the repository's own comparison of the six tools that connect a UI5 app to a backend lists both, and separates them on which of the two embeds the CAP server. In a project it is one development dependency of the UI5 project, on @ui5/cli 3 or higher.

Facts

Latestv3.3.6ReleasedLast pushLicenceApache-2.0

Where it sits

Lives in
Provides
Build and dev-server toolingUI5Build and dev-server toolingcapabilityServing an app locally and building it for deployment — proxying a backend, transpiling, bundling, and shaping the result for whatever will host it.
Requires
@sap/cds≥ 6.8.1@sap/cdsartifactThe CDS server it embeds: the middleware calls cds serve internally to create the middleware functions and puts them into the UI5 development server.@ui5/cli@ui5/cliartifactThe dev server it plugs into as a custom middleware, and the specVersion: "3.0" its configuration is written against.

Who is behind it

Peter MuessigPeter MuessigPersonMaintains this
In the atlas: maintains 14, contributes to 80, wrote 1
@petermuessig
UI5 CommunityUI5 CommunityOrganisationMaintains this
In the atlas: maintains 69
@ui5-community
maintainersDimitar FenerskiPersonContributes to this
In the atlas: contributes to 23
@dfenerski
Dominik FeiningerPersonContributes to this
In the atlas: contributes to 11
@dominikfeininger
Florian VogtPersonContributes to this
In the atlas: contributes to 50, wrote 2
@flovogt
Dominik HeimPersonContributes to this
In the atlas: contributes to 25
@heimwege
4 contributors

What it declares

Every artifact

Type
Build tool
Origin
By a community org
Runtime
Node.js

As a build tool

Declared for
>=6.8.1
Distributed through
npm

Connections5

ui5-middleware-cap connectionsui5-middleware-capFUNCTIONAL→ alternative to1alternative to authoredcds-plugin-ui5→ provides1provides stated Registers a UI5 CLI custom middleware that calls `cds serve` and embeds the CDS server's express middlewares into the dev server, at the url `mountPath` names and from the npm package `moduleId` names. ui5-middleware-cap — npm: https://www.npmjs.com/package/ui5-middleware-cap ui5-middleware-cap — README: https://raw.githubusercontent.com/ui5-community/ui5-ecosystem-showcase/main/packages/ui5-middleware-cap/README.md ui5-middleware-cap — README, mountPath: https://raw.githubusercontent.com/ui5-community/ui5-ecosystem-showcase/main/packages/ui5-middleware-cap/README.md ui5-middleware-cap — README, moduleId: https://raw.githubusercontent.com/ui5-community/ui5-ecosystem-showcase/main/packages/ui5-middleware-cap/README.mdBuild and dev-server toolingUSED BY← needed by1needed by derived The middleware the viewer demos: it is what puts the CAP server into the UI5 server that serves the app. Through: inverted from its requires edge ui5-bookshop-viewer — README, title: https://github.com/ui5-community/ui5-ecosystem-showcase/tree/main/showcases/ui5-bookshop-viewer ui5-ecosystem-showcase — README, repository layout: https://github.com/ui5-community/ui5-ecosystem-showcaseui5-bookshop-viewerNEEDS→ needs2needs declared The CDS server it embeds: the middleware calls `cds serve` internally to create the middleware functions and puts them into the UI5 development server. ui5-middleware-cap — README, options: https://raw.githubusercontent.com/ui5-community/ui5-ecosystem-showcase/main/packages/ui5-middleware-cap/README.md ui5-middleware-cap — package.json, peerDependencies: https://raw.githubusercontent.com/ui5-community/ui5-ecosystem-showcase/main/packages/ui5-middleware-cap/package.json@sap/cdsneeds declared The dev server it plugs into as a custom middleware, and the `specVersion: "3.0"` its configuration is written against. ui5-middleware-cap — README, Prerequisites: https://raw.githubusercontent.com/ui5-community/ui5-ecosystem-showcase/main/packages/ui5-middleware-cap/README.md ui5-middleware-cap — package.json, peerDependencies: https://raw.githubusercontent.com/ui5-community/ui5-ecosystem-showcase/main/packages/ui5-middleware-cap/package.json@ui5/cli

Install

npm add ui5-middleware-cap

Derived from the package name. No recipe recorded; the README has the configuration.

README

quoted from ui5-community/ui5-ecosystem-showcase under Apache-2.0, read
ui5-community/ui5-ecosystem-showcase/packages/ui5-middleware-cap/README.mdOn GitHub

ui5-middleware-cap

👋 This is an open‑source, community‑driven project, developed and actively monitored by members of the UI5 community. You are welcome to use it, report issues, contribute enhancements, and support others in the community.

The ui5-middleware-cap is a UI5 CLI middleware which is used to improve the development experience for the node runtime of the SAP Cloud Application Programming Model (CAP) and enables the integration of a CDS server into the UI5 development server via the CDS server express middlewares. In addition to the middleware the CDS server project needs to be added as dependency so that the server is detected and attached properly. The pre-defined routes in the CDS server are reused.

Prerequisites

⚠️ UI5 CLI Compatibility All releases of this UI5 CLI extension using the major version 3 require UI5 CLI V3. Any previous releases below major version 3 (if available) also support older versions of the UI5 CLI. But the usage of the latest UI5 CLI is strongly recommended!

Usage

Add a devDependency to the ui5-middleware-cap:

npm add ui5-middleware-cap -D

Register the middleware in the ui5.yaml:

server:
  customMiddleware:
  - name: ui5-middleware-cap
    afterMiddleware: compression
    mountPath: "/cap"

That's it!

Configuration options (in $yourapp/ui5.yaml)

  • moduleId: <string> If specified, the CDS server will be loaded from the NPM package with the given moduleId (package name). If not provided, the middleware will lookup the CDS server from the project dependencies or devDependencies.
  • mountPath: <string> If specified, the CDS server will be available at the specified url.
  • options: <object> (default: { "with-mocks": true, "in-memory?": true } ) Allows to provide some CLI options for the cds serve command which is called internally to create the middleware functions and embed them into the UI5 development server:
    • with-mocks: <boolean> It starts in-process mock services for all required services configured in package.json#cds.requires, which don't have external bindings in the current process environment.
    • in-memory[?]: <boolean> Automatically adds a transient in-memory database bootstrapped on each (re-)start in the same way cds deploy would do, based on defaults or configuration in package.json#cds.requires.db. Add a question mark to apply a more defensive variant which respects the configured database, if any, and only adds an in-memory database if no persistent one is configured.

Support

Please use the GitHub bug tracking system to post questions, bug reports or to create pull requests.

Contributing

Any type of contribution (code contributions, pull requests, issues) to this set of UI5 CLI extensions will be equally appreciated.

License

This work is licensed under Apache 2.0.

Built with care (and a lot of caffeine). If this helped you build, test, or ship, the next coffee — or drink — is on you when you bump into a contributor.

Apache-2.0, read

History

Latest

v3.3.6

Fixes 1

Notes
Patch Changes
  • #1373 3c544b7 Thanks @petermuessig! - Bump the express peerDependency floor from >=4.18.2 to >=4.19.2 so the declared range no longer permits versions affected by GHSA-rv95-896h-c2vc (open redirect). Closes Dependabot alerts #110, #111, #113, #114, #115, #117.

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

  1. v3.3.5

    Notes

    Note: Version bump only for package ui5-middleware-cap

  2. v3.3.4

    Notes

    Note: Version bump only for package ui5-middleware-cap

  3. v3.3.3

    Notes

    Note: Version bump only for package ui5-middleware-cap

  4. v3.3.2

    Notes

    Note: Version bump only for package ui5-middleware-cap

  5. v3.3.1

    Notes

    Note: Version bump only for package ui5-middleware-cap

  6. v3.3.0

    Features 1

    Notes
    Features
    • enhanced v4 compat + update dependencies (#1070) (2d7ed16)
  7. v3.2.14

    Fixes 1

    Notes
    Bug Fixes
    • decouple tooling extensions from UI5 tooling version (#1058) (6694c59), closes #1054
  8. v3.2.13

    Notes

    Note: Version bump only for package ui5-middleware-cap

  9. v3.2.12

    Notes

    Note: Version bump only for package ui5-middleware-cap

  10. v3.2.11

    Notes

    Note: Version bump only for package ui5-middleware-cap

  11. v3.2.10

    Notes

    Note: Version bump only for package ui5-middleware-cap

  12. v3.2.9

    Notes

    Note: Version bump only for package ui5-middleware-cap

  13. v3.2.8

    Notes

    Note: Version bump only for package ui5-middleware-cap

  14. v3.2.7

    Notes

    Note: Version bump only for package ui5-middleware-cap

  15. v3.2.6

    Fixes 1

    Notes
    Bug Fixes
    • cds-plugin-ui5: support odata and odata-v4 endpoints (#930) (249e18d)
  16. v3.2.5

    Notes

    Note: Version bump only for package ui5-middleware-cap

  17. v3.2.4

    Notes

    Note: Version bump only for package ui5-middleware-cap

  18. v3.2.3

    Notes

    Note: Version bump only for package ui5-middleware-cap

  19. v3.2.2

    Notes

    Note: Version bump only for package ui5-middleware-cap

  20. v3.2.1

    Notes

    Note: Version bump only for package ui5-middleware-cap

  21. v3.2.0

    Features 1

    Notes
    Features
    • ui5-middleware-cap: wrap @sap/cds/bin/serve command (#869) (541e6e6)
  22. v3.1.5

    Fixes 1

    Notes
    Bug Fixes
    • no cache for rewrite, cds server lookup (#843) (fc7b9b5)
  23. v3.1.4

    Fixes 1

    Notes
    Bug Fixes
    • prevent side-effects for combined scenarios (#842) (36aaa5f)
  24. v3.1.3

    Fixes 1

    Notes
    Bug Fixes
    • ui5-middleware-cap: support cds-plugins (af5585c)
  25. v3.1.2

    Notes

    Note: Version bump only for package ui5-middleware-cap

  26. v3.1.1

    Fixes 1

    Notes
    Bug Fixes
    • cap endpoint detection, dev-approuter showcase (#827) (c3abb2a), closes #826
  27. v3.1.0

    Features 1

    Notes
    Features
    • ui5-middleware-cap: applyCAPMiddleware provides server info (#798) (fed3685)
  28. v3.0.1

    Notes

    Note: Version bump only for package ui5-middleware-cap

  29. v3.0.0dated in the atlas

    Breaking 1, Features 2

    Notes
    Features
    BREAKING CHANGES
    • The support for UI5 Tooling V2 has been removed
  30. v0.1.4

    Fixes 1

    Notes
    Bug Fixes
    • ui5-middleware-cap: proper dependency handling / decoupling (#774) (2493a06)
  31. v0.1.3

    Fixes 1

    Notes
    Bug Fixes
    • ui5-tooling-transpile: transpile at startup + caching (#757) (6c7946d)
  32. v0.1.2

    Fixes 1

    Notes
    Bug Fixes
  33. v0.1.1

    Fixes 1

    Notes
    Bug Fixes
  34. v0.1.0

    Features 1

    Notes
    Features
    • ui5-middleware-cap: initial poc for CAP middleware (#745) (d38bb6d)
1,156downloads per week, npm
Weekly downloads for ui5-middleware-cap26 complete calendar weeks from 2026-04-20 to 2026-10-18; the latest total is 1156.20 Apr – 26 Apr: 1,47527 Apr – 3 May: 1,6524 May – 10 May: 1,09711 May – 17 May: 90018 May – 24 May: 1,81525 May – 31 May: 1,1441 Jun – 7 Jun: 2858 Jun – 14 Jun: 66615 Jun – 21 Jun: 87522 Jun – 28 Jun: 1,08629 Jun – 5 Jul: 1,1746 Jul – 12 Jul: 1,32613 Jul – 19 Jul: 65920 Jul – 26 Jul: 71827 Jul – 2 Aug: 4253 Aug – 9 Aug: 75210 Aug – 16 Aug: 89917 Aug – 23 Aug: 91724 Aug – 30 Aug: 51831 Aug – 6 Sept: 4177 Sept – 13 Sept: 46514 Sept – 20 Sept: 1,33621 Sept – 27 Sept: 73528 Sept – 4 Oct: 9155 Oct – 11 Oct: 31812 Oct – 18 Oct: 1,156
Declared alternative
  1. cds-plugin-ui5UI5 CLI middlewares running inside the CDS server
Build and dev-server tooling
  1. UI5 ToolsVS Code extension to serve, proxy, build and deploy UI5 projects
  2. ui5-middleware-route-proxyUI5 server middleware proxying route prefixes to a backend
  3. ui5-task-cachebuster-indexingUI5 builder task preparing build output for the cachebuster
  4. ui5-task-transpile-genUI5 builder task transpiling ES6 to ES5 with Babel
  5. ui5-middleware-odata-recorderUI5 middleware recording OData traffic as mock server datasets
  6. ui5-plugin-loaderUI5 Tooling v4 extension that registers other extensions
  7. ui5-deployerUI5 Tooling module deploying Fiori/UI5 apps to SAP systems
  8. ui5-task-dts-generatorUI5 builder task generating d.ts type declarations
  9. ui5-task-minifierUI5 builder task minifying HTML, CSS and JSON files
  10. ui5-middleware-oidcUI5 dev server middleware adding an OpenID Connect login
  11. generator-ui5-library-af-deployYeoman generator for Application Frontend config in UI5 libraries
  12. ui5-middleware-destinationUI5 Tooling middleware proxying destinations and neo-app.json routes
  13. ui5-task-check-eocpUI5 build task warning when the app's UI5 version reaches EOCP
  14. @ui5/cliUI5 Tooling command line for project setup, dev server and build
  15. ui5-task-btp-manifestUI5 Tooling task writing the service name into the importer manifest
  16. ui5-middleware-approuterUI5 CLI middleware proxying the dev server through @sap/approuter
  17. ui5-middleware-hmrExperimental UI5 middleware for hot module replacement
  18. ui5-middleware-iasyncUI5 middleware syncing interactions across browsers over websocket
  19. ui5-middleware-indexUI5 middleware serving a chosen welcome page at the root path
  20. ui5-middleware-livereloadLive reload middleware for the UI5 dev server
  21. ui5-middleware-oneloginUI5 middleware logging in with Playwright and reusing the session
  22. ui5-middleware-serveframeworkUI5 middleware serving a locally built UI5 framework
  23. ui5-middleware-servestaticUI5 middleware serving static resources from a path or npm package
  24. ui5-middleware-simpleproxyDev-server middleware proxying requests to a backend system
  25. ui5-middleware-ui5UI5 middleware including one UI5 application in another
  26. ui5-middleware-webjarsUI5 middleware serving static resources from JAR files (WebJars)
  27. ui5-middleware-websocketWebSocket support for Express-based dev servers such as UI5's
  28. ui5-task-cachebusterUI5 builder task cachebusting standalone UI5 applications
  29. ui5-task-copyrightUI5 builder task appending copyright headers to source files
  30. ui5-task-flatten-libraryUI5 builder task flattening library output for SAP NetWeaver
  31. ui5-task-i18ncheckUI5 builder task checking XML views for missing i18n texts
  32. ui5-task-minify-xmlUI5 builder task minifying XML views and fragments
  33. ui5-task-pwa-enablerUI5 builder task turning a UI5 app into a progressive web app
  34. ui5-task-zipperBuild task packaging the UI5 build result as a zip archive
  35. ui5-tooling-lessUI5 CLI extension compiling Less files into CSS
  36. ui5-tooling-modulesUI5 tooling extensions loading npm packages as UI5 modules
  37. ui5-tooling-stringreplaceUI5 CLI extension for string replacement during the build
  38. ui5-tooling-transpileUI5 CLI extension transpiling code during the UI5 build
  39. @ui5/loggerInternal logger of the UI5 CLI
  40. @ui5/middleware-code-coverageUI5 CLI middleware for Istanbul code coverage
  41. @ui5/tooling-webcDeprecated UI5 Tooling extensions for UI5 Web Components wrappers

Details

Sources4
Added by handdiscovered herechecked
npm registry, ui5-middleware-capversion, releases, installschecked
github.com/https://github.com/ui5-community/ui5-ecosystem-showcase.gittree, pushes, contributors, CIchecked
packages/ui5-middleware-cap/README.mdquoted, and what the entry declareschecked

Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.

Compatibility and provenance
runtimesnode
declared for>=6.8.1
latestv3.3.6
first release
releases and cadence35, ~26d median
discovered viaAdded by hand
first seen in the atlas
ecosystem and domainui5, developer-experience
Contributors4

From the repository’s contributor list, .

History in the atlas8
  1. A UI5 CLI project's dev server serves the app, and the CAP services it calls run in a second process started and stopped on its own. This middleware calls `cds serve` and embeds the express middlewares it returns into the UI5 dev server, so one command answers both: it is entered under `server/customMiddleware` in `ui5.yaml`, where `mountPath` sets the url the CDS server answers on and `moduleId` names the npm package the CDS server is loaded from. Its default options are `with-mocks` and `in-memory?`, which start in-process mock services for required services that have no external binding and add a transient in-memory database bootstrapped on each restart. It is the counterpart of [cds-plugin-ui5](artifact:ui5-community-cds-plugin-ui5), which embeds the other way round, the UI5 CLI middlewares inside the CDS server; the repository's own comparison of the six tools that connect a UI5 app to a backend lists both, and separates them on which of the two embeds the CAP server. In a project it is one development dependency of the UI5 project, on [@ui5/cli](artifact:sap-ui5-cli) 3 or higher.
  2. UI5 CLI middleware that runs a CDS server inside the UI5 dev server, mounted at a path the UI5 project configures.
  3. capability:ui5-build-tooling, with what_it_does and the README's own sentences on the middleware, mountPath and moduleId
  4. The maintainers publish the two as members of one set and compare them in one table. The repository README: "Six tools in this repo can connect a UI5 app to a backend (`cds-plugin-ui5`, `ui5-middleware-cap`, `ui5-middleware-approuter`, `@sap/approuter`, `dev-approuter`, `ui5-middleware-simpleproxy`)." The comparison in docs/backend-connectivity.md is what separates this pair: "| Embeds CAP server | ❌ | ✅ | (✅)¹ | ❌ | ✅ | (✅)¹ |", the first two columns being cds-plugin-ui5 and ui5-middleware-cap. The inverse edge is derived, so cds-plugin-ui5 shows it without being edited.
  5. runtimes node, cds_range >=6.8.1
  6. artifact:sap-cds, artifact:sap-ui5-cli
  7. Peter Muessig, actor:petermuessig and actor:ui5-community
  8. First seen.
For your agent
Ref
artifact:ui5-community-ui5-middleware-cap
JSON
/artifacts/ui5-community-ui5-middleware-cap.json
MCP
Connecting an agent