@lomray/microservice-configuration v2.4.0
configuration
RPC 2.0 Microservice.
This microservice provides configuration for all other microservices. Single point for store configurations of microservices.
Navigation
ENVIRONMENTS:
NODE_ENV
- Can beproduction
ordevelopment
ortests
. Default:development
MS_CONNECTION
- Invert json host and port (with protocol). Default:http://127.0.0.1:8001
MS_CONNECTION_SRV
- Invert json connection it is SRV record. Default:false
MS_NAME
- Microservice name. Default:gateway
MS_WORKERS
- Microservice queue workers count. Default:5
MS_ENABLE_REMOTE_MIDDLEWARE
- Enable remote middleware feature. Set0
to disable. Default:1
(enabled)DB_URL
- Database url connection string. Default:undefined
. Please use URL or credentials.DB_HOST
- Database host. Default:127.0.0.1
DB_PORT
- Database port. Default:5432
DB_USERNAME
- Database user name. Default:postgres
DB_PASSWORD
- Database password. Default:example
DB_DATABASE
- Database db name. Default:ms-configuration
MS_INIT_CONFIGS
- JSON string for configure initialConfig
values. Default:[]
MS_INIT_MIDDLEWARES
- JSON string for configure initialMiddleware
values. Default:[]
HOW TO RUN:
- Run
Inverted Json
job server.
docker run -it -p 8001:8001 lega911/ijson --log 47
- Run microservice (please, see
ENVIRONMENTS
above for understand config)
npm run start:dev
- Make some request
curl localhost:8001/ms/configuration -d '{"id": "unique-id", "method": "demo", "params": {}}'
If you use JetBrains
IDE, try to find run configurations in .run
You can also install microservice like npm package:
npm i --save @lomray/microservice-configuration
HOW TO DEVELOP:
For develop this microservice, preferred use TDD technique.
You can run all tests with watch
flag or run one test:
// case 1
npm run test -- --watch
// case 2
NODE_ENV=tests TS_NODE_COMPILER_OPTIONS='{"target":"es6"}' mocha --harmony --no-warnings __tests__/your-test-name.ts --require ts-node/register --recursive --watch
// check code coverage
nyc npm run test
That is all. Don't forget install npm dependencies
(in root folder & local folder run: npm ci
)
MEMORY USAGE:
Run on typescript: ~200 MB PEAK / ~180 MB
Run on JS: ~36 MB PEAK / ~25 MB
10 days ago
10 days ago
11 days ago
1 month ago
2 months ago
2 months ago
5 months ago
5 months ago
5 months ago
9 months ago
7 months ago
7 months ago
9 months ago
9 months ago
12 months ago
11 months ago
12 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago