Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vedi/simple-moleculer-starter
https://github.com/vedi/simple-moleculer-starter
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/vedi/simple-moleculer-starter
- Owner: vedi
- License: mit
- Created: 2019-04-30T05:08:32.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-02-11T20:37:47.000Z (almost 3 years ago)
- Last Synced: 2024-10-05T07:14:37.468Z (3 months ago)
- Language: JavaScript
- Size: 165 KB
- Stars: 2
- Watchers: 4
- Forks: 1
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Simple Moleculer Starter
## Intro
Simple reimplementation of moleculer-runner https://moleculer.services/docs/0.12/moleculer-cli.html.
Primary goal: allowing runner to pass control to other modules of the app after moleculer initialisation.
In order to achieve that we implemented another param `--next` in the runner, where you can pass a path to your js-module.
This module will be resolved (via `require`), and it's export function will be called with `moleculerBroker` as a param.For instance. You can define script `start: node node_modules/simple-moleculer-starter --next app`. And create the following file `app.js`:
```$js
module.export = (broker) => {
console.log('broker has been initialized');
}
```## Differences
### Supported params
As it's a simple implementation of the runner, we did not support all possible params of the original cli.
But just supported the following:
* `--hot` / `-H`,
* `--repl` / `-r`,### Services
Services to be started should be provided by `SERVICES` env var. However we support plain glob patterns for this, relatively `services` directory of the app.
## License
The project is available under the MIT license.