Scaffold out a Devis microservices project.
Node.js 22.18 or later is required.
npm install -g yo generator-devis
mkdir my-project && cd my-project
yo devisThe generator asks for a project name and which Devis plugins to add: devis-mongo-client, devis-pub_sub-redis and devis_rabbitmq.
my-project/
├── gateway.js HTTP gateway forwarding GET /hello to the hello microservice
├── services/hello/
│ ├── index.js the microservice patterns (and the selected plugins)
│ └── server.js exposes the microservice over TCP
└── test/hello.test.js starts both processes and calls the gateway
Run it:
npm run start:service
npm run start:gateway
curl "http://127.0.0.1:8080/hello?name=devis"The project uses Devis 4.1: handlers are async functions, the gateway awaits its calls without naming a connection (Devis routes them to the microservice that announced the pattern), answers 502 when the microservice fails or does not answer within 5 seconds, and reconnects when it restarts. Both processes shut down cleanly on SIGTERM.
Add a microservice by copying services/hello, changing its patterns and port, and connecting to it from the gateway with devis.connect: calls to its patterns are routed to it.
Since 2.1, generated projects target Devis 4 instead of Devis 3; since 2.2, Devis 4.1.
Version 2 generates a much smaller project targeting Devis 3. The Wakanda configuration, the Angular front end, the mongoose model generator and the devis shell command are gone: they relied on the Devis 1 API (devis.client, devis.act), which no longer exists. Use the plugins above for data storage and messaging.
MIT