What is @ui5/server?
@ui5/server is a development server for UI5 projects. It provides a local server environment to serve UI5 applications and libraries, enabling developers to test and debug their UI5 projects locally.
What are @ui5/server's main functionalities?
Serve UI5 Applications
This feature allows you to serve a UI5 application locally. The code sample demonstrates how to set up a server on port 8080 to serve resources from the './webapp' directory.
const { serve } = require('@ui5/server');
const server = serve({
port: 8080,
resources: {
path: './webapp'
}
});
server.start();
Middleware Support
This feature allows you to add custom middleware to the server. The code sample shows how to log the request URL using a custom middleware function.
const { serve } = require('@ui5/server');
const server = serve({
port: 8080,
resources: {
path: './webapp'
},
middleware: [
function customMiddleware(req, res, next) {
console.log('Request URL:', req.url);
next();
}
]
});
server.start();
Live Reload
This feature enables live reloading of the application when changes are detected. The code sample demonstrates how to enable live reload by setting the 'liveReload' option to true.
const { serve } = require('@ui5/server');
const server = serve({
port: 8080,
resources: {
path: './webapp'
},
liveReload: true
});
server.start();
Other packages similar to @ui5/server
http-server
http-server is a simple, zero-configuration command-line HTTP server. It can be used to serve static files and is often used for quick local development. Unlike @ui5/server, it does not have built-in support for UI5-specific features like middleware or live reload.
live-server
live-server is a simple development HTTP server with live reload capability. It automatically reloads the page when files change. While it provides live reload similar to @ui5/server, it lacks UI5-specific middleware support.
webpack-dev-server
webpack-dev-server is a development server that provides live reloading and other features for projects using Webpack. It is highly configurable and supports middleware, but it is more complex to set up compared to @ui5/server, which is tailored for UI5 projects.

ui5-server
Modules for running a UI5 development server
Part of the UI5 Tooling

⌨️ CLI reference can be found here!
Server
Provides server capabilities for the UI5 Tooling.
Middleware
The development server has already a set of middleware which supports the developer with the following features:
- Translation files with
.properties
extension are properly encoded with ISO-8859-1. - Changes on files with
.less
extension triggers a theme build and delivers the compiled CSS files. - Version info is created automatically (
/resources/sap-ui-version.json
). - List project files with URL (needed exclusively by the OpenUI5 testsuite):
/discovery/app_pages
, /discovery/all_libs
, /discovery/all_tests
Certificates for HTTPS or HTTP/2
The UI5 Server can automatically generate an SSL certificate for HTTPS and HTTP/2 configurations.
Upon startup, it checks if a certificate exists within the path provided.
If there is none, a new certificate is created and used.
Hint: If Chrome unintentionally redirects a HTTP-URL to HTTPS, you need to delete the HSTS mapping in chrome://net-internals/#hsts by entering the domain name (e.g. localhost) and pressing "delete".
Contributing
Please check our Contribution Guidelines.
Support
Please follow our Contribution Guidelines on how to report an issue.
Release History
See CHANGELOG.md.
License
This project is licensed under the Apache Software License, Version 2.0 except as noted otherwise in the LICENSE file.