Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tylersnyder/serve-micro-cluster
It's like Path Alias on now, but for local development.
https://github.com/tylersnyder/serve-micro-cluster
cluster micro microservices nodejs
Last synced: 3 months ago
JSON representation
It's like Path Alias on now, but for local development.
- Host: GitHub
- URL: https://github.com/tylersnyder/serve-micro-cluster
- Owner: tylersnyder
- Created: 2017-03-25T19:24:37.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-04-13T14:23:00.000Z (over 7 years ago)
- Last Synced: 2024-05-08T10:31:10.443Z (6 months ago)
- Topics: cluster, micro, microservices, nodejs
- Language: JavaScript
- Homepage:
- Size: 38.1 KB
- Stars: 19
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-micro - serve-micro-cluster - It's like Path Alias on now, but for local development. (Development Tools / Utilities)
README
# serve-micro-cluster
Easily start a local cluster of [`micro`](https://github.com/zeit/micro)-based services using a simple `rules.json` file. It's like *Path Alias* on [now](https://zeit.co/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](https://github.com/tylersnyder/serve-micro-cluster/tree/master/example).### Alternatives
- [dev-gateway](https://github.com/dimapaloskin/dev-gateway) Local development cluster with "now" path aliases syntax support. Allows running multiple microservices as one solid server.
- [micro-cluster](https://github.com/zeit/micro-cluster) - Run multiple micro servers and a front proxy at a time