mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[AAE-6455] use tpl format instead of json and replace values (#2374)
* Use the tpl instead of json and replace values for build start and e2e * Use different license file name to avoid conflicts * use the travis value * Use the general ng build and add doc
This commit is contained in:
@@ -1,5 +1,43 @@
|
||||
let fallback = require('connect-history-api-fallback');
|
||||
require('@alfresco/adf-cli/tooling').dotenvConfig();
|
||||
var proxyMiddleware = require('http-proxy-middleware');
|
||||
|
||||
function getProxy(contentHost) {
|
||||
return {
|
||||
'/alfresco': {
|
||||
target: contentHost,
|
||||
secure: false,
|
||||
changeOrigin: true,
|
||||
// workaround for REPO-2260
|
||||
onProxyRes: function (proxyRes, req, res) {
|
||||
const header = proxyRes.headers['www-authenticate'];
|
||||
if (header && header.startsWith('Basic')) {
|
||||
proxyRes.headers['www-authenticate'] = 'x' + header;
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getMiddleWares() {
|
||||
var counter = 0;
|
||||
const proxies = {
|
||||
...getProxy(process.env.APP_CONFIG_ECM_HOST),
|
||||
};
|
||||
const appMiddlewares = Object.keys(proxies).reduce((accumulator, proxyName) => {
|
||||
counter++;
|
||||
return {
|
||||
...accumulator,
|
||||
[counter]: proxyMiddleware(proxyName, proxies[proxyName]),
|
||||
}
|
||||
}, {});
|
||||
counter++;
|
||||
|
||||
return {
|
||||
...appMiddlewares,
|
||||
[counter]: fallback({ index: '/index.html', verbose: true }),
|
||||
};
|
||||
}
|
||||
module.exports = {
|
||||
injectChanges: false, // workaround for Angular 2 styleUrls loading
|
||||
files: ['./**/*.{html,htm,css,js}'],
|
||||
@@ -11,8 +49,6 @@ module.exports = {
|
||||
port: 4200,
|
||||
open: false,
|
||||
server: {
|
||||
middleware: {
|
||||
1: fallback({ index: '/index.html', verbose: true })
|
||||
}
|
||||
middleware: getMiddleWares(),
|
||||
}
|
||||
};
|
||||
};
|
Reference in New Issue
Block a user