microservice-nodejs-lib
NodeJS Microservices based onMicroservices list:
Use npm run create-microservice name
for create new microservice from template.
How to start
Use docker-compose to run all in one command (docker-compose up
) or:
- Run
Inverted Json
job server.
docker run -it -p 8001:8001 lega911/ijson --log 47
- Run
gateway
microservice.
docker run -it -p 8001:8001 ghcr.io/lomray-software/microservices/gateway:latest-staging
- Run other needed microservices (the same actions as in step 2, just replace docker image).
- That is all. Check it:
curl -X POST http://127.0.0.1:3000
-H 'Content-Type: application/json'
-d '{"id":"unique-id-1","method":"microservice-name.method","params":{}}'
Chek all available microservices
Microservices also available like npm packages:
npm i --save @lomray/microservice-NAME
# for e.g.
npm i --save @lomray/microservice-configuration
Complete example
Just run:
git clone git@github.com:Lomray-Software/microservices.git
cd example
docker-compose up
see example requests in file requests.http
Integration tests
- Run all microservices
- Run commands:
cd tests
npm run test
TODO
- Add api service generator (backend) (generate api service for microservices based on metadata endpoint)
- Add api service generator (frontend)