This package has been deprecated

Author message:

Please use micro-proxy instead

micro-cluster

1.0.0 • Public • Published

micro-cluster

XO code style

Run multiple micro servers and a front proxy at a time, with a simple configuration file.

Example

Create a config file like the following.

export default {
  services: {
    myService: {
      path: 'index.js',
      env: { NODE_ENV: 'production' }
    },
    woot: 'woot.js'
  },
 
  locations: {
    '^/path-regex/to/serve/?$': {
      rewrite: ['^(.*)$', '$1/rewritten'],
      proxySetHeaders: { 'X-CUSTOM-HEADER': '1' },
      proxy: 'myService'
    }
    '^/woot/?$': 'woot'
  }
}

Run servers.

micro-cluster -p 3000 app.js

Readme

Keywords

none

Package Sidebar

Install

npm i micro-cluster

Weekly Downloads

0

Version

1.0.0

License

none

Last publish

Collaborators

  • leo