NodeJS Microservices helpers for microservices
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
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
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
FIREBASE_CREDENTIAL- Firebase credential JSON string. Default:{}FIREBASE_FROM_CONFIG_MS- Get firebase credential from configuration microservice. Set0to disable. Default:1
- 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.