2.4.0 • Published 10 days ago

@lomray/microservice-notification v2.4.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
10 days ago

notification

RPC 2.0 Microservice.
This microservice provides notifications mechanism.

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: notification
  • MS_CONFIG_NAME - Configuration microservice name. Default: configuration
  • MS_WORKERS - Microservice queue workers count. Default: 5
  • MS_ENABLE_REMOTE_MIDDLEWARE - Enable remote middleware feature. Set 0 to disable. Default: 1 (enabled)
  • DB_FROM_CONFIG_MS - Get db credentials from configuration microservice. Set 0 to disable. Default: 1
  • 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-users
  • EMAIL_PROVIDER - Email provider. Default: nodemailer
  • EMAIL_DEFAULT_FROM - The email address from which messages will be sent. It can be configured from remote config. Default: undefined
  • EMAIL_FROM_CONFIG_MS - Get email sdk credentials (nodemailer) from configuration microservice. Set 0 to disable. Default: 1
  • EMAIL_TRANSPORTER_OPTIONS - Nodemailer transport options (if not configured from remote config.). JSON string. Default: {}
  • AWS_ACCESS_KEY_ID - AWS access key, if you will use SES for sending email (if not configured from remote config.). Default: empty
  • AWS_SECRET_ACCESS_KEY - AWS secret access key, if you will use SES for sending email (if not configured from remote config.). Default: empty
  • AWS_REGION - AWS region, if you will use SES for sending email (if not configured from remote config.). Default: empty

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/notification -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-notification

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: ~177 MB PEAK / ~162 MB
Run on JS: ~33 MB PEAK / ~26 MB

2.4.0

10 days ago

2.3.0

10 days ago

2.1.0-beta.1

10 days ago

2.0.0

11 days ago

2.0.0-beta.34

1 month ago

2.0.0-beta.33

2 months ago

2.0.0-beta.32

2 months ago

2.0.0-beta.31

5 months ago

2.0.0-beta.30

5 months ago

2.0.0-beta.29

5 months ago

2.0.0-beta.28

5 months ago

2.0.0-beta.22

8 months ago

2.0.0-beta.21

9 months ago

2.0.0-beta.20

9 months ago

2.0.0-beta.26

5 months ago

2.0.0-beta.25

5 months ago

2.0.0-beta.24

7 months ago

2.0.0-beta.23

7 months ago

2.0.0-beta.27

5 months ago

2.0.0-beta.19

9 months ago

2.0.0-beta.18

10 months ago

2.0.0-beta.15

11 months ago

2.0.0-beta.14

12 months ago

2.0.0-beta.13

12 months ago

2.0.0-beta.17

11 months ago

2.0.0-beta.11

1 year ago

2.0.0-beta.10

1 year ago

2.0.0-beta.12

1 year ago

2.0.0-beta.9

1 year ago

2.0.0-beta.8

1 year ago

2.0.0-beta.7

1 year ago

1.1.0-beta.6

1 year ago

1.1.0-beta.5

1 year ago

2.0.0-beta.2

1 year ago

2.0.0-beta.1

1 year ago

2.0.0-beta.6

1 year ago

2.0.0-beta.5

1 year ago

2.0.0-beta.4

1 year ago

2.0.0-beta.3

1 year ago

1.0.10-beta.1

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.9-beta.1

1 year ago

1.0.7-beta.1

1 year ago

1.0.5-beta.1

1 year ago

1.1.0-beta.2

1 year ago

1.1.0-beta.1

1 year ago

1.1.0-beta.4

1 year ago

1.1.0-beta.3

1 year ago

1.0.11-beta.1

1 year ago

1.0.8-beta.1

1 year ago

1.0.6-beta.1

1 year ago

1.0.4-beta.1

1 year ago

1.0.3-beta.1

1 year ago

1.0.10

1 year ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

1.0.0-beta.51

2 years ago

1.0.0-beta.50

2 years ago

1.0.2-beta.2

2 years ago

1.0.1-beta.1

2 years ago

1.0.2-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.28

2 years ago

1.0.0-beta.29

2 years ago

1.0.0-beta.46

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

2 years ago

1.0.0-beta.23

2 years ago

1.0.0-beta.21

2 years ago

1.0.0-beta.26

2 years ago

1.0.0-beta.27

2 years ago

1.0.0-beta.24

2 years ago

1.0.0-beta.25

2 years ago

1.0.0-beta.12

2 years ago

1.0.0-beta.20

2 years ago

1.0.0-beta.19

2 years ago

1.0.0-beta.17

2 years ago

1.0.0-beta.18

2 years ago

1.0.0-beta.15

2 years ago

1.0.0-beta.16

2 years ago

1.0.0-beta.13

2 years ago

1.0.0-beta.14

2 years ago

1.0.0-beta.2

2 years ago

1.0.0-beta.3

2 years ago

1.0.0-beta.4

2 years ago

1.0.0-beta.5

2 years ago

1.0.0-beta.11

2 years ago

1.0.0-beta.10

2 years ago

1.0.0-beta.6

2 years ago

1.0.0-beta.7

2 years ago

1.0.0-beta.8

2 years ago

1.0.0-beta.9

2 years ago

1.0.0-beta.1

2 years ago