Skip to content

Latest commit

 

History

History
62 lines (43 loc) · 1.92 KB

File metadata and controls

62 lines (43 loc) · 1.92 KB

UI5 middleware for delivering a welcome/start/'index' page to the client

Middleware for ui5-server, delivering the $index.html of choice (instead of the directory listing).

Install

npm install ui5-middleware-index --save-dev

Configuration options (in $yourapp/ui5.yaml)

  • index: string, default: index.html
    file inside $yourapp to deliver for http://<host>:<port>/
  • debug: bool, default: false

Usage

  1. Define the dependency in $yourapp/package.json:
"devDependencies": {
    // ...
    "ui5-middleware-index": "*"
    // ...
},
"ui5": {
  "dependencies": [
    // ...
    "ui5-middleware-index",
    // ...
  ]
}

As the devDependencies are not recognized by the UI5 tooling, they need to be listed in the ui5 > dependencies array. In addition, once using the ui5 > dependencies array you need to list all UI5 tooling relevant dependencies.

  1. configure it in $yourapp/ui5.yaml:
server:
  customMiddleware:
  - name: ui5-middleware-index
    afterMiddleware: compression
    configuration:
      index: "index_peter.html"

How it works

The middleware delivers the configured index HTML-file to the client if the FQDN + trailing slash / is requested in the browser.

Development

If you want to contribute to ui5-middleware-index, please use Prettier for code formatting/style and apply the rules from ./.prettierrc. Thanks 🙏!

License

This work is dual-licensed under Apache 2.0 and the Derived Beer-ware License. The official license will be Apache 2.0 but finally you can choose between one of them if you use this work.

When you like this stuff, buy @vobu, @stefanbeck3, github.com/margopolo a beer or buy @pmuessig a coke when you see them.