In case if someone is looking for multiple context entries to the same target or TypeScript based configuration.
proxy.conf.ts
const proxyConfig = [
{
context: ['/api/v1', '/api/v2],
target: 'https://example.com',
secure: true,
changeOrigin: true
},
{
context: ['**'], // Rest of other API call
target: 'http://somethingelse.com',
secure: false,
changeOrigin: true
}
];
module.exports = proxyConfig;
ng serve --proxy-config=./proxy.conf.ts -o