notification-micro-service-client
v1.3.3
Published
> *npm i notification-micro-service-client-lib*
Downloads
1
Readme
Installation
npm i notification-micro-service-client-lib
Configuration
The module has two environment variables by default.
- HOST = http://notification-service:8080
- API_KEY = ""
Of course these variables can be updated in a few steps.
Step 1
After installing the module, go to notification-microservice-client-lib directory in node_modules via this command:
cd node_modules/notification-micro-service-client-lib
Step 2
Once you are in notification-micro-service-client-lib directory, run the command:
npm run build -- --env HOST=myHost
Note that you can add as many environment variables as you want before each one adds --env:
npm run build -- --env HOST=myHost --env API_KEY=03i5-3gr-4w3-32e
Step 3
Congratulations, now your application will work with your environment variables!
Usage
The object in the module that is used is service:
import { service } from 'notification-micro-service-client'
The main method that is called through it is sendEmail
service.sendEmail(email, isAsync)