Skip to content

xinitrc86/ui5-middleware-route-proxy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UI5 proxy middleware using routes

Middleware for ui5-server, enabling proxy support.

Install

npm install ui5-middleware-route-proxy --save-dev

Configuration options (in $yourapp/ui5.yaml)

  • debug: boolean enable logging
  • root directory of the request uri: object used to match and forward requests to your server
    • target: string hostname of your backend server
    • auth: object authorization object with username and password
      • fromEnv: boolean optional. If true user and pass represents existing variables in .env file for that specific target
      • user: string
      • pass: string

Example:

      debug: true
      sap: 
        target: http(s)://host:port
        auth:
          user: Username
          pass: Password!

Example with user/pass in .env file:

      debug: true
      sap: 
        target: http(s)://host:port
        auth:
          fromEnv: true
          user: PROXY_USERNAME
          pass: PROXY_PASSWORD

Usage

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

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-route-proxy
    afterMiddleware: compression
    configuration:
      debug: true
      routeRootPath: 
        target: http(s)://host:port
        auth:
          fromEnv: true
          user: PROXY_USERNAME
          pass: PROXY_PASSWORD
  1. Add a .env file with your username and password for the proxy:
PROXY_USERNAME=<username>
PROXY_PASSWORD=<password>

About

UI5Tooling route proxy

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%