This project is an example of how to create a monorepo that contains two microservices built with Node.js and using Redis as a message broker. Docker Compose is also used to facilitate the deployment of the services.
- Node.js 16 o higher
- Yarn
- Docker y Docker Compose
- Make (optional)
You can use the RedisInsight GUI to connect to your Redis instance
- Clone the repository
- Run yarn install in the root of the project to install the dependencies for each microservice
- Run yarn build in the root of the project to create the dist folder for each microservice
- Run docker-compose up to start the Redis and two microservices containers
- Check on the console that the microservices ok messages were executed
You can execute the message from the publisher using curl:
curl -X POST -H "Content-Type: application/json" -d '{message: "your message"}' http://localhost:3000
You can use the makefile script by running:
- This will execute the default message 'Hello world'
make send
- Pass your own message
make send msg="your message"