2.4.0 • Published 8 months ago

@lomray/microservice-gateway v2.4.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
8 months ago

Gateway

RPC 2.0 Microservice. This is a single entry point for all clients.

Version
GitHub GitHub package.json dependency version (dev dep on branch)

Quality Gate Status Reliability Rating Security Rating Vulnerabilities Lines of code Coverage

Navigation

ENVIRONMENTS:

  • NODE_ENV - Can be production or development or tests. 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_CONFIG_NAME - Configuration microservice name. Default: configuration
  • MS_ENABLE_REMOTE_MIDDLEWARE - Enable remote middleware feature. Set 0 to disable. Default: 1 (enabled)
  • MS_BATCH_LIMIT - Batch JSON_RPC request size. Default: 5
  • MS_INFO_ROUTE - Gateway info route. Default: /
  • MS_REQ_TIMEOUT - Gateway request timeout in sec. Default: 15

HOW TO RUN:

  1. Run Inverted Json job server.
docker run -it -p 8001:8001 lega911/ijson --log 47
  1. Run microservice (please, see ENVIRONMENTS above for understand config)
npm run start:dev
  1. 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-gateway

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: ~165 MB PEAK / ~158 MB
Run on JS: ~58 MB PEAK / ~47 MB

2.4.0

8 months ago

2.3.0

8 months ago

2.0.0

8 months ago

2.0.0-beta.30

9 months ago

2.0.0-beta.29

10 months ago

2.0.0-beta.28

10 months ago

2.0.0-beta.27

1 year ago

2.0.0-beta.26

1 year ago

2.0.0-beta.22

1 year ago

2.0.0-beta.21

1 year ago

2.0.0-beta.20

1 year ago

2.0.0-beta.25

1 year ago

2.0.0-beta.24

1 year ago

2.0.0-beta.23

1 year ago

2.0.0-beta.11

2 years ago

2.0.0-beta.15

2 years ago

2.0.0-beta.14

2 years ago

2.0.0-beta.13

2 years ago

2.0.0-beta.12

2 years ago

2.0.0-beta.19

2 years ago

2.0.0-beta.18

2 years ago

2.0.0-beta.17

2 years ago

2.0.0-beta.16

2 years ago

2.0.0-beta.10

2 years ago

2.0.0-beta.9

2 years ago

2.0.0-beta.8

2 years ago

2.0.0-beta.7

2 years ago

2.0.0-beta.6

2 years ago

1.1.0-beta.5

2 years ago

2.0.0-beta.2

2 years ago

2.0.0-beta.1

2 years ago

2.0.0-beta.5

2 years ago

2.0.0-beta.4

2 years ago

2.0.0-beta.3

2 years ago

1.0.2

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.9-beta.1

2 years ago

1.0.7-beta.1

2 years ago

1.0.5-beta.1

2 years ago

1.1.0-beta.2

2 years ago

1.1.0-beta.1

2 years ago

1.1.0-beta.4

2 years ago

1.1.0-beta.3

2 years ago

1.0.8-beta.1

2 years ago

1.0.6-beta.1

2 years ago

1.0.4-beta.1

2 years ago

1.0.3-beta.2

2 years ago

1.0.2-beta.2

2 years ago

1.0.3-beta.1

2 years ago

1.0.2-beta.1

2 years ago

1.0.10

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

1.0.0-beta.55

2 years ago

1.0.0-beta.53

2 years ago

1.0.0-beta.54

2 years ago

1.0.1-beta.1

2 years ago

1.0.0-beta.44

2 years ago

1.0.0-beta.45

2 years ago

1.0.0-beta.42

2 years ago

1.0.0-beta.43

2 years ago

1.0.0-beta.40

2 years ago

1.0.0-beta.41

2 years ago

1.0.0-beta.48

2 years ago

1.0.0-beta.49

2 years ago

1.0.0-beta.46

2 years ago

1.0.0-beta.47

2 years ago

1.0.0-beta.33

2 years ago

1.0.0-beta.34

2 years ago

1.0.0-beta.31

2 years ago

1.0.0-beta.32

2 years ago

1.0.0-beta.30

2 years ago

1.0.0-beta.39

2 years ago

1.0.0-beta.37

2 years ago

1.0.0-beta.38

2 years ago

1.0.0-beta.35

2 years ago

1.0.0-beta.36

2 years ago

1.0.0-beta.22

3 years ago

1.0.0-beta.23

3 years ago

1.0.0-beta.28

2 years ago

1.0.0-beta.29

2 years ago

1.0.0-beta.26

2 years ago

1.0.0-beta.27

2 years ago

1.0.0-beta.24

3 years ago

1.0.0-beta.25

3 years ago

1.0.0-beta.20

3 years ago

1.0.0-beta.21

3 years ago

1.0.0-beta.19

3 years ago

1.0.0-beta.17

3 years ago

1.0.0-beta.18

3 years ago

1.0.0-beta.15

3 years ago

1.0.0-beta.16

3 years ago

1.0.0-beta.13

3 years ago

1.0.0-beta.14

3 years ago

1.0.0-beta.3

3 years ago

1.0.0-beta.4

3 years ago

1.0.0-beta.5

3 years ago

1.0.0-beta.11

3 years ago

1.0.0-beta.12

3 years ago

1.0.0-beta.10

3 years ago

1.0.0-beta.6

3 years ago

1.0.0-beta.7

3 years ago

1.0.0-beta.8

3 years ago

1.0.0-beta.9

3 years ago

1.0.0-beta.2

3 years ago

1.0.0-beta.1

3 years ago

1.0.0-staging.1

3 years ago