@zengenti/contensis-react-base 3.0.1-beta.3 → 3.0.1-beta.4
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.
|
@@ -707,17 +707,18 @@ const alias = ALIAS;
|
|
|
707
707
|
/* global ALIAS */
|
|
708
708
|
|
|
709
709
|
const deliveryApiHostname = urls.url(alias, project).api;
|
|
710
|
-
const
|
|
710
|
+
const assetProxy = httpProxy__default["default"].createProxyServer();
|
|
711
|
+
const deliveryProxy = httpProxy__default["default"].createProxyServer();
|
|
711
712
|
|
|
712
713
|
const reverseProxies = (app, reverseProxyPaths = []) => {
|
|
713
|
-
deliveryApiProxy(
|
|
714
|
+
deliveryApiProxy(deliveryProxy, app);
|
|
714
715
|
app.all(reverseProxyPaths, (req, res) => {
|
|
715
716
|
const target = req.hostname.indexOf('preview-') || req.hostname.indexOf('preview.') || req.hostname === 'localhost' ? servers.previewIis || servers.iis : servers.iis;
|
|
716
|
-
|
|
717
|
+
assetProxy.web(req, res, {
|
|
717
718
|
target,
|
|
718
719
|
changeOrigin: true
|
|
719
720
|
});
|
|
720
|
-
|
|
721
|
+
assetProxy.on('error', e => {
|
|
721
722
|
/* eslint-disable no-console */
|
|
722
723
|
console.log(`Proxy Request for ${req.path} HostName:${req.hostname} failed with ${e}`);
|
|
723
724
|
/* eslint-enable no-console */
|
|
@@ -4407,7 +4408,7 @@ const start = (ReactApp, config, ServerFeatures) => {
|
|
|
4407
4408
|
|
|
4408
4409
|
var internalServer = {
|
|
4409
4410
|
app,
|
|
4410
|
-
apiProxy,
|
|
4411
|
+
apiProxy: deliveryProxy,
|
|
4411
4412
|
start
|
|
4412
4413
|
};
|
|
4413
4414
|
|