git clone [email protected]:Sampath-vi/remote.git
cd remote; npm install; npm start;
- The app should start on port 8081.- Expose this port via ngrok or use the
localhost
and copy the URL. This URL will be necessary for the host app to acccess these resources.
- This app consists of a
Counter
andHealth
component which will both be reused in thehost app
. - The
Counter
component just increments the state locally. - The
Health
component uses mobx store to fetch the config-backend health and display the result.
- The resources are being exposed via webpack in a file called
remoteEntry.js
. Once the server is up, navigate tohttp://localhost:8081/remoteEntry.js
. - Components are being exposed and configured in
webpack.config.js
- webpack.config.js - More on Module Federation - module-federation