This is a template project for building API service using Moleculer and express.js. It also uses PostgreSQL as database and Sequelize as ORM.
Start the project with npm run dev
command.
In the terminal, try the following commands:
nodes
- List all connected nodes.actions
- List all registered service actions.call user.test
- Call theuser.test
action.call user.hello
- Call theuser.hello
action.
- api: API Gateway services
- user: Sample service with
test
,hello
, anduser
actions.
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