@lomray/microservice-gateway v2.4.0
Gateway
RPC 2.0 Microservice. This is a single entry point for all clients.
Navigation
ENVIRONMENTS:
NODE_ENV- Can beproductionordevelopmentortests. Default:developmentMS_CONNECTION- Invert json host and port (with protocol). Default:http://127.0.0.1:8001MS_CONNECTION_SRV- Invert json connection it is SRV record. Default:falseMS_NAME- Microservice name. Default:gatewayMS_CONFIG_NAME- Configuration microservice name. Default:configurationMS_ENABLE_REMOTE_MIDDLEWARE- Enable remote middleware feature. Set0to disable. Default:1(enabled)MS_BATCH_LIMIT- Batch JSON_RPC request size. Default:5MS_INFO_ROUTE- Gateway info route. Default:/MS_REQ_TIMEOUT- Gateway request timeout in sec. Default:15
HOW TO RUN:
- Run
Inverted Jsonjob server.
docker run -it -p 8001:8001 lega911/ijson --log 47- Run microservice (please, see
ENVIRONMENTSabove for understand config)
npm run start:dev- Make some request
curl localhost:8001/ms/gateway -d '{"id": "unique-id", "method": "demo", "params": {}}'
# or
curl localhost:3000 -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-gatewayHOW 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 testThat is all. Don't forget install npm dependencies
(in root folder & local folder run: npm ci)
MEMORY USAGE:
Run on typescript: ~165 MB PEAK / ~158 MB
Run on JS: ~58 MB PEAK / ~47 MB
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
3 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
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago