This repository has been archived by the owner. It is now read-only.
Run multiple micro servers and a front proxy at a time
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
.gitignore
gulpfile.js
license.md
package-lock.json
package.json
readme.md

readme.md

micro-cluster


DEPRECATED: Please use micro-proxy instead. This repo right here is not maintained anymore.


XO code style Slack Channel

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