This is a Moleculer-based microservices project. Generated with the Moleculer CLI.
After npm install
, start the project with npm run dev
command.
After starting, open the http://localhost:5000/ URL in your browser.
In the terminal, try the following commands:
nodes
- List all connected nodes.actions
- List all registered service actions.call suspects.list
- Call thesuspects.list
action.call passengers.check --name Arlequina --temperature 37
- Call thepassengers.check
action with thename
andtemperature
parameter.
- api: API Gateway services
- suspects: DB service responsible for providing a list of known suspects. To use with MongoDB, set
MONGO_URI
environment variables and install MongoDB adapter withnpm i moleculer-db-adapter-mongo
. - passengers: Service responsible for receive passengers name and check their temperature. If the temperature is greater than or equal to 38 degree, an event fever.detected is emitted warning that fever was detected and doctors will be awaited.-
- doctors: Service responsible for listening to events
fever.detected
and providing appropriate care. - lab: Service that will be the agent of the moleculer lab.
- db.mixin: Database access mixin for services. Based on moleculer-db
- Moleculer website: https://moleculer.services/
- Moleculer Documentation: https://moleculer.services/docs/0.14/
npm run dev
: Start development mode (load all services locally with hot-reload & REPL)npm run start
: Start production mode (setSERVICES
env variable to load certain services)npm run cli
: Start a CLI and connect to production. Don't forget to set production namespace with--ns
argument in scriptnpm run ci
: Run continuous test mode with watchingnpm test
: Run tests & generate coverage report