@sap-ux/ui5-proxy-middleware 1.3.14 → 1.3.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,6 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
+ const express_1 = require("express");
15
16
  const logger_1 = require("@sap-ux/logger");
16
17
  const base_1 = require("../base");
17
18
  const dotenv_1 = __importDefault(require("dotenv"));
@@ -36,15 +37,11 @@ function createProxyOptions(logger, config) {
36
37
  * @returns handler function
37
38
  */
38
39
  function createRequestHandler(routes) {
39
- return (req, res, next) => {
40
- for (const route of routes) {
41
- if (req.path.startsWith(route.route)) {
42
- route.handler(req, res, next);
43
- return;
44
- }
45
- }
46
- next();
47
- };
40
+ const router = (0, express_1.Router)();
41
+ for (const route of routes) {
42
+ router.get(`${route.route}*`, route.handler);
43
+ }
44
+ return router;
48
45
  }
49
46
  /**
50
47
  * Search the project for the manifest.json.
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "bugs": {
10
10
  "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Aui5-proxy-middleware"
11
11
  },
12
- "version": "1.3.14",
12
+ "version": "1.3.15",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",