Socket
Book a DemoInstallSign in
Socket

@sap-ux/preview-middleware

Package Overview
Dependencies
Maintainers
3
Versions
563
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sap-ux/preview-middleware

Preview middleware

Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
73K
-5.86%
Maintainers
3
Weekly downloads
 
Created
Source

@sap-ux/preview-middleware

The @sap-ux/preview-middleware is a Custom UI5 Server Middleware for previewing an application in a local Fiori launchpad . It can be used either with the ui5 serve or the fiori run commands.

Configuration Options

OptionTypeDefault ValueDescription
flpOptional configuration object for the local Fiori launchpad
flp.pathstring/test/flp.htmlThe mount point of the local Fiori launchpad.
flp.appsarray[]Optional additional local apps that are available in local Fiori launchpad
debugbooleanfalseEnables debug output

flp.apps

Array of additional application configurations:

OptionTypeDefault ValueDescription
targetstringTarget path of the additional application
localstringLocal path to the folder containing the application
intentOptional intent to be used for the application
intent.objectstring(calculated)Optional intent object, if it is not provided then it will be calculated based on the application id
intent.actionstringpreviewOptional intent action

Usage

The middleware can be used without configuration. However, since the middleware intercepts a few requests that might otherwise be handled by a different middleware, it is strongly recommended to run other file serving middlewares after the preview-middleware e.g. backend-proxy-middleware and ui5-proxy-middleware (and the corresponding middlewares in the @sap/ux-ui5-tooling). Example: ./test/fixtures/simple-app/ui5.yaml

Minimal Configuration

With no configuration provided, the app will be local FLP will be available at /test/flp.html and the log level is info.

server:
  customMiddleware:
  - name: preview-middleware
    afterMiddleware: compression

Different Path and Debugging enabled

With this configuration, the app will be local FLP will be available at /preview.html and the log level is debug.

server:
  customMiddleware:
  - name: preview-middleware
    afterMiddleware: compression
    configuration:
      flp: 
        path: /preview.html
      debug: true

Additional Applications

If you want to test cross application navigation, then you can add additional applications into the local FLP. With this configuration, an application that is locally available in ../local-folder will be available at /apps/other-app and will also be added as tile to the local FLP.

server:
  customMiddleware:
  - name: preview-middleware
    afterMiddleware: compression
    configuration:
      apps:
        - local: ../local-folder
          target: /apps/other-app

FAQs

Package last updated on 17 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts