1.0.1 • Published 11 months ago

@chang-ch/mfe-proxy v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
11 months ago
  npm i --save-dev mfe-proxy

This is a proxy server that listens to webpack dev servers published with bonjour and proxies requests to the local/remote servers.

The server will proxy requests from /{module name}/... to either the local source or the remote source specified.

  1. Create a config file
remotes:
  component1:
    remoteUrl: remote.com # remote URL to get module from
    moduleName: component1 # name of remote module
    bonjourName: webpack-component1 # name of bonjour server
  1. start mfe-proxy:
> mfe-proxy

A config panel will be available on the root url of the port (e.g. localhost:8080)

  1. Change module sources as desired in the config panel

    • local will try to proxy requests from /{module name}/... to localhost:port/... of the local dev server if available. If local dev server is unavailable requests are proxied to the remote url in the config
    • remote will proxy requests from /{module name}/... to {remoteUrl}/....
1.0.1

11 months ago

1.0.0

11 months ago