abigby
abigby

Reputation: 11

Angular Micro Frontend micro-app's services url keeps getting replaced by Shell app's url

In my Nx workspace, I have 2 Angular apps where I am using Webpack Module Federation to create a Micro Frontend architecture. Standalone the micro-apps works fine, however, when they are routed to via the shell app URLs for their services are replaced by Shell app's URL

i.e

shell app url localhost:3000 micro-app url localhost:4000 micro-app-api urls are replaced as localhost:3000/api-url/... instead of maintaining its path localhost:4000/api-url/...

Upvotes: 0

Views: 1453

Answers (1)

Gokce Akcan
Gokce Akcan

Reputation: 71

I see it's been some time over this question, but I had the same issue and updating build command in package.json to set base-href and deploy-url resolved the issue.

Try adding --base-href http://localhost:4000/ --deploy-url http://localhost:4000/ to the build command. Hope it helps.

Upvotes: 0

Related Questions