manfredsteyer / module-federation-plugin-example

264 stars 182 forks source link

Angular CLI proxy for configure several microApps #6

Open edgarjoao opened 3 years ago

edgarjoao commented 3 years ago

Hi Manfred, Thank you for provide this kind of open source plugins that will help to the community.

Based in the example of the implementation of the MicroApp and Host/Shell App, the idea it's great as you have described below. image

For Host/Shell App, is that possible to use Angular proxy CLI instead?

<some-element-ui microApp="/some-element-ui/main.js">
<some-element-ui/>

Host/Shell Angular CLI proxy configuration

const PROXY_CONFIG = [
    {
        context: [
            "/some-element-ui"
        ],
        target: "http://localhost:3000",
        pathRewrite: {
            "^/some-element-ui" : ""
        },
        secure: false,
        changeOrigin: true
    }
]

module.exports = PROXY_CONFIG;

Thanks, Edgar

abhitheflame commented 2 years ago

I am facing the same issue. I have a shell app [angular 13] hosted on my local IIS on port 2000 and a MF app which is hosted on IIS on port 1001. I have loaded my MF within shell app using dynamic module federation in shell route. I am getting CORS error for MF app. Kindly suggest solution.