2.1.0 • Published 8 years ago

serve-micro-cluster v2.1.0

Weekly downloads
2
License
MIT
Repository
-
Last release
8 years ago

serve-micro-cluster

Easily start a local cluster of micro-based services using a simple rules.json file. It's like Path Alias on now, but for local development.

Installation

Install serve-micro-cluster globally.

npm install -g serve-micro-cluster

// or

yarn global add serve-micro-cluster

Usage

Define a rules.json file. If your file has a name other than rules, use the -f flag to let serve-micro-cluster know. This comes in handy if you're keeping multiple versions of your rules available in the same directory (development, production.)

{
  "rules": [
    {
      "pathname": "/accounts",
      "dest": "./services/accounts/index.js"
    },
    ...
  ]
}

You can also define port and env variables:

{
  "rules": [
    {
      ...
      "port": 4000,
      "env": {
        "SECRET_KEY": "supersecret"
      }
    }
}

Once your rules are defined, you can start your microservices and proxy server using serve-micro-cluster.

  "scripts": {
    "start": "serve-micro-cluster"
  }

The following options are available:

  • -h, --host (default localhost)
  • -p, --port (default 3000)
  • -f, --file (default rules.json)

Example

See serve-micro-cluster/example.

2.1.0

8 years ago

2.0.0

8 years ago

1.9.4

8 years ago

1.9.3

8 years ago

1.9.2

8 years ago

1.9.1

8 years ago

1.9.0

8 years ago

1.8.1

8 years ago

1.8.0

8 years ago

1.7.0

8 years ago

1.6.0

8 years ago

1.5.0

8 years ago

1.2.0

8 years ago

1.1.3

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.9

8 years ago

1.0.8

8 years ago