monorepo/services
Nicholai Nissen cde1fafacb feat: add script service 2021-04-03 18:24:07 +02:00
..
mixins first commit 2021-04-01 19:58:41 +02:00
models fix(script): make video optional 2021-04-03 18:23:51 +02:00
public first commit 2021-04-01 19:58:41 +02:00
services feat: add script service 2021-04-03 18:24:07 +02:00
test first commit 2021-04-01 19:58:41 +02:00
types first commit 2021-04-01 19:58:41 +02:00
util first commit 2021-04-01 19:58:41 +02:00
.dockerignore first commit 2021-04-01 19:58:41 +02:00
.editorconfig first commit 2021-04-01 19:58:41 +02:00
.eslintrc.js first commit 2021-04-01 19:58:41 +02:00
.gitignore first commit 2021-04-01 19:58:41 +02:00
Dockerfile first commit 2021-04-01 19:58:41 +02:00
README.md first commit 2021-04-01 19:58:41 +02:00
docker-compose.env first commit 2021-04-01 19:58:41 +02:00
docker-compose.yml first commit 2021-04-01 19:58:41 +02:00
k8s.yaml first commit 2021-04-01 19:58:41 +02:00
moleculer.config.ts first commit 2021-04-01 19:58:41 +02:00
package-lock.json first commit 2021-04-01 19:58:41 +02:00
package.json first commit 2021-04-01 19:58:41 +02:00
tsconfig.json first commit 2021-04-01 19:58:41 +02:00

README.md

Moleculer

redplateaus

This is a Moleculer-based microservices project. Generated with the Moleculer CLI.

Usage

Start the project with npm run dev command. After starting, open the http://localhost:3000/ URL in your browser. On the welcome page you can test the generated services via API Gateway and check the nodes & services.

In the terminal, try the following commands:

  • nodes - List all connected nodes.
  • actions - List all registered service actions.
  • call greeter.hello - Call the greeter.hello action.
  • call greeter.welcome --name John - Call the greeter.welcome action with the name parameter.
  • call products.list - List the products (call the products.list action).

Services

  • api: API Gateway services
  • greeter: Sample service with hello and welcome actions.
  • products: Sample DB service. To use with MongoDB, set MONGO_URI environment variables and install MongoDB adapter with npm i moleculer-db-adapter-mongo.

Mixins

  • db.mixin: Database access mixin for services. Based on moleculer-db

NPM scripts

  • npm run dev: Start development mode (load all services locally with hot-reload & REPL)
  • npm run start: Start production mode (set SERVICES 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 script
  • npm run lint: Run ESLint
  • npm run ci: Run continuous test mode with watching
  • npm test: Run tests & generate coverage report
  • npm run dc:up: Start the stack with Docker Compose
  • npm run dc:down: Stop the stack with Docker Compose