Registry / web-framework / ui5-middleware-servestatic

ui5-middleware-servestatic

JSON →
library3.5.0jsnpmunverified

ui5-middleware-servestatic v3.5.0 is a community-driven middleware for the UI5 tooling that serves static resources during development. It integrates serve-static to serve files from a root path or an npm package path. Compatible with @ui5/cli@3.0.0+ and specVersion 3.0. Release cadence is moderate, with fixes and features driven by community needs. Key differentiator: simple configuration for custom static resource serving in UI5 projects, supporting environment variables and runtime path resolution.

npm install ui5-middleware-servestatic
INSTALL
IMPORT
SIG · UI5-MIDDLEWARE-SER
U
ui5-middleware-servestatic
web-frameworkjavascriptv3.5.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import middleware from 'ui5-middleware-servestatic'
const middleware = require('ui5-middleware-servestatic')
ESM is preferred, but CJS require also works as the package exports both.
serveStatic
import { serveStatic } from 'ui5-middleware-servestatic'
import serveStatic from 'ui5-middleware-servestatic'
Named export for the core serveStatic function, used for custom integrations.
middleware
import { middleware } from 'ui5-middleware-servestatic'
Import the default export and use it as middleware.
The package exports a `middleware` named export as well.

Shows installation, configuration in ui5.yaml, and programmatic usage of the middleware with Express.

// Install: npm install ui5-middleware-servestatic --save-dev // In ui5.yaml: // server: // customMiddleware: // - name: ui5-middleware-servestatic // afterMiddleware: compression // mountPath: /resources // configuration: // rootPath: /path/to/static/resources // Implementation example: import express from 'express'; import { middleware } from 'ui5-middleware-servestatic'; const app = express(); app.use('/resources', middleware({ rootPath: '/path/to/static/resources', debug: true })); app.listen(3000, () => console.log('Server running on port 3000'));
Debug
Known issues
breakingMajor version 3 requires @ui5/cli@3.0.0+ and specVersion 3.0.
fix
Upgrade @ui5/cli to version 3 or later and update ui5.yaml specVersion to 3.0.
affects: >=3.0.0
deprecatedThe `rootPath` option with a relative path is deprecated; use absolute paths or environment variables instead.
fix
Use absolute paths or prefix with env. for environment variables.
affects: >=2.0.0 <3.0.0
gotchaIf both `rootPath` and `npmPackagePath` are provided, `rootPath` takes precedence.
fix
Provide only one of the two options to avoid confusion.
affects: all
Errors
Common errors & fixes
Cannot find module 'ui5-middleware-servestatic'
Package not installed or not in node_modules.
fix
Run `npm install ui5-middleware-servestatic --save-dev`.
ERROR #UI5/00012: Middleware 'ui5-middleware-servestatic' not found
UI5 CLI cannot locate the middleware in ui5.yaml dependencies.
fix
Ensure the package is listed in devDependencies and npm install succeeded.
TypeError: Cannot read properties of undefined (reading 'rootPath')
Configuration object missing in ui5.yaml under the middleware entry.
fix
Add `configuration: { rootPath: '...' }` to your middleware definition.
Upgrade
Version history
3.5.0latest on npm
Audit
Dependencies
@ui5/clirequiredRequired at version 3.0.0+ for specVersion 3.0 support
serve-staticrequiredUsed internally to serve static files
Agent activity
5 hits · last 30 days
node
4
Resources
ui5-middleware-servestatic — npm install ui5-middleware-servestatic · libregistry