@sap-ux/backend-proxy-middleware
Advanced tools
Comparing version 0.6.21 to 0.6.22
@@ -17,3 +17,2 @@ "use strict"; | ||
const logger_1 = require("@sap-ux/logger"); | ||
const express_1 = require("express"); | ||
const http_proxy_middleware_1 = require("http-proxy-middleware"); | ||
@@ -50,3 +49,2 @@ const proxy_1 = require("./base/proxy"); | ||
dotenv_1.default.config(); | ||
const router = express_1.Router(); | ||
const backend = options.configuration.backend; | ||
@@ -57,4 +55,12 @@ const configOptions = (_a = options.configuration.options) !== null && _a !== void 0 ? _a : {}; | ||
const proxyOptions = yield proxy_1.generateProxyMiddlewareOptions(options.configuration.backend, configOptions, logger); | ||
router.use(backend.path, http_proxy_middleware_1.createProxyMiddleware(proxyOptions)); | ||
const proxyFn = http_proxy_middleware_1.createProxyMiddleware(proxyOptions); | ||
logger.info(`Starting backend-proxy-middleware using following configuration:\nbackend: ${JSON.stringify(Object.assign(Object.assign({}, backend), { proxy: formatProxyForLogging(backend.proxy) }))}\noptions: ${JSON.stringify(configOptions)}'`); | ||
return (req, res, next) => { | ||
if (req.path.startsWith(backend.path)) { | ||
proxyFn(req, res, next); | ||
} | ||
else { | ||
next(); | ||
} | ||
}; | ||
} | ||
@@ -66,4 +72,3 @@ catch (e) { | ||
} | ||
return router; | ||
}); | ||
//# sourceMappingURL=middleware.js.map |
@@ -12,3 +12,3 @@ { | ||
}, | ||
"version": "0.6.21", | ||
"version": "0.6.22", | ||
"license": "Apache-2.0", | ||
@@ -25,3 +25,3 @@ "author": "@SAP/ux-tools-team", | ||
"dependencies": { | ||
"@sap-ux/axios-extension": "0.9.7", | ||
"@sap-ux/axios-extension": "0.9.8", | ||
"@sap-ux/btp-utils": "0.11.1", | ||
@@ -32,3 +32,2 @@ "@sap-ux/logger": "0.3.0", | ||
"dotenv": "16.0.0", | ||
"express": "4.17.2", | ||
"http-proxy-middleware": "2.0.1", | ||
@@ -41,7 +40,8 @@ "https-proxy-agent": "5.0.0", | ||
"@types/express": "4.17.13", | ||
"@types/http-proxy": "^1.17.5", | ||
"@types/prompts": "2.0.14", | ||
"@types/http-proxy": "^1.17.5", | ||
"@types/supertest": "2.0.12", | ||
"express": "4.17.2", | ||
"nock": "13.2.4", | ||
"supertest": "6.2.2", | ||
"@types/supertest": "2.0.12", | ||
"yaml": "2.0.0-10" | ||
@@ -48,0 +48,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
56522
10
838
8
+ Added@sap-ux/axios-extension@0.9.8(transitive)
- Removedexpress@4.17.2
- Removed@sap-ux/axios-extension@0.9.7(transitive)
- Removedaccepts@1.3.8(transitive)
- Removedarray-flatten@1.1.1(transitive)
- Removedbody-parser@1.19.01.19.1(transitive)
- Removedbytes@3.1.03.1.1(transitive)
- Removedcontent-disposition@0.5.30.5.4(transitive)
- Removedcontent-type@1.0.5(transitive)
- Removedcookie@0.4.00.4.1(transitive)
- Removedcookie-signature@1.0.6(transitive)
- Removeddebug@2.6.9(transitive)
- Removeddepd@1.1.2(transitive)
- Removeddestroy@1.0.4(transitive)
- Removedee-first@1.1.1(transitive)
- Removedencodeurl@1.0.2(transitive)
- Removedescape-html@1.0.3(transitive)
- Removedetag@1.8.1(transitive)
- Removedexpress@4.17.14.17.2(transitive)
- Removedfinalhandler@1.1.2(transitive)
- Removedforwarded@0.2.0(transitive)
- Removedfresh@0.5.2(transitive)
- Removedhttp-errors@1.7.21.8.1(transitive)
- Removediconv-lite@0.4.24(transitive)
- Removedinherits@2.0.3(transitive)
- Removedipaddr.js@1.9.1(transitive)
- Removedmedia-typer@0.3.0(transitive)
- Removedmerge-descriptors@1.0.1(transitive)
- Removedmethods@1.1.2(transitive)
- Removedmime@1.6.0(transitive)
- Removedmime-db@1.52.0(transitive)
- Removedmime-types@2.1.35(transitive)
- Removedms@2.0.02.1.1(transitive)
- Removednegotiator@0.6.3(transitive)
- Removedon-finished@2.3.0(transitive)
- Removedparseurl@1.3.3(transitive)
- Removedpath-to-regexp@0.1.7(transitive)
- Removedproxy-addr@2.0.7(transitive)
- Removedqs@6.9.6(transitive)
- Removedrange-parser@1.2.1(transitive)
- Removedraw-body@2.4.02.4.2(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedsend@0.17.10.17.2(transitive)
- Removedserve-static@1.14.11.14.2(transitive)
- Removedsetprototypeof@1.1.11.2.0(transitive)
- Removedstatuses@1.5.0(transitive)
- Removedtoidentifier@1.0.01.0.1(transitive)
- Removedtype-is@1.6.18(transitive)
- Removedunpipe@1.0.0(transitive)
- Removedutils-merge@1.0.1(transitive)
- Removedvary@1.1.2(transitive)