Package Exports
- @lomray/microservice-helpers
- @lomray/microservice-helpers/helpers/get-constants
- @lomray/microservice-helpers/helpers/get-constants.js
- @lomray/microservice-helpers/helpers/resolve-srv
- @lomray/microservice-helpers/helpers/resolve-srv.js
- @lomray/microservice-helpers/helpers/tracer
- @lomray/microservice-helpers/helpers/tracer.js
- @lomray/microservice-helpers/index.js
- @lomray/microservice-helpers/methods/meta
- @lomray/microservice-helpers/methods/meta.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@lomray/microservice-helpers) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
NodeJS Microservices helpers for microservices
COMMON ENVIRONMENTS:
NODE_ENV- Can beproductionordevelopmentortests. Default:developmentENVIRONMENT- Extra environment name. Default:prodMS_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:authenticationMS_WORKERS- Microservice queue workers count. Default:5MS_ENABLE_REMOTE_MIDDLEWARE- Enable remote middleware feature. Set0to disable. Default:1(enabled)MS_REMOTE_CONFIG_ENABLE- Enable remote config (get from configuration microservice). Set0to disable. Default:1MS_CONFIG_NAME- Configuration microservice name. Default:configurationENABLE_EVENTS- Enable events if microservice support it. Default:0MS_GRAFANA_LOKI_CONFIG- Grafana loki config. Default:nullMS_ENABLE_GRAFANA_LOG- Enable grafana loki log (config from configuration ms). Default:0MS_OPENTELEMETRY_ENABLE- Enable opentelemetry tracers. Default:0MS_DISABLE_OPENTELEMETRY_TRACES- Disable opentelemetry traces. Default:0MS_DISABLE_OPENTELEMETRY_METRICS- Disable opentelemetry metrics. Default:0MS_OPENTELEMETRY_OTLP_URL- Custom opentelemetry OTLP exporter URL. Default:undefinedMS_OPENTELEMETRY_OTLP_URL_SRV- Custom opentelemetry OTLP URL it is SRV record. Default:0MS_OPENTELEMETRY_DEBUG- Enable debug log opentelemetry. Default:0MS_CONSOLE_LOG_LEVEL- Change console log level, see all levels. Default:info
COMMON ENVIRONMENTS - DB SUPPORT:
DB_URL- Database url connection string. Default:undefined. Please use URL or credentials.DB_HOST- Database host. Default:127.0.0.1DB_PORT- Database port. Default:5432DB_USERNAME- Database user name. Default:postgresDB_PASSWORD- Database password. Default:exampleDB_DATABASE- Database name. Default:ms-microservice-nameDB_FROM_CONFIG_MS- Get DB credentials from configuration microservice. Set0to disable. Default:1
COMMON ENVIRONMENTS - AWS SUPPORT:
AWS_ACCESS_KEY_ID- AWS access key ID. Default:undefinedAWS_SECRET_ACCESS_KEY- AWS secret access key. Default:undefinedAWS_REGION- AWS region. Default:undefinedAWS_BUCKET_NAME- AWS S3 bucket name. Default:undefinedAWS_BUCKET_ACL- AWS S3 bucket ACL (e.g.: public-read). Default:undefinedAWS_FROM_CONFIG_MS- Get AWS credentials from configuration microservice. Set0to disable. Default:1
COMMON ENVIRONMENTS - FIREBASE SUPPORT:
FIREBASE_CREDENTIAL- Firebase credential JSON string. Default:{}FIREBASE_FROM_CONFIG_MS- Get firebase credential from configuration microservice. Set0to disable. Default:1
This package contains:
- Entities
- IJson Query filter
- Mocks
- Typeorm
- Typeorm extension
- Helpers
- Launchers (with/without db)
- Create DB connection
- Get common microservices constants (see list ENVIRONMENT)
- Get entity columns (EntityColumns)
- Redact secrets for console outputs
- Resolve SRV records
- Tracer
- Services
- API Client (make requests to another microservices)
- CRUD
- Log
- Microservice metadata
- Remote config
- Firebase SDK
- Class validator: extra validators
- Test helpers
- Instrumentations for collect metrics
See microservices for example of usage.