This microservice is designed to listen to SQS Queue and send emails. The details are all included in the fetched message payload.
EmailPayload = {
to: string;
subject: string;
text: string;
};
- Listen To SQS Queue and Send Emails: Listing to SQS Queue and sending emails.
- Language/Framework: [ Typescript, Node.js with Express]
- Cloud Technology [ AWS SQS ]
- Containerization: [ Docker ]
- Install node v18.19.0
-
Clone the repository:
git clone https://github.com/ShashwotBhattarai/emailer_microservice.git
-
Install NPM packages:
npm install
-
Add env variables:
EMAILER= PASSWORD= SERVICE= AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_REGION= S3_BUCKET_NAME= SQS_QUEUE_URL= ENV= PORT= ACCESS_CONTROL_ALLOW_ORIGIN_URL=
-
Run the application:
npm run start
-
To test apis:
Health check API: curl --location 'http://localhost:3005/emailer/health' \ --data ''
npm run testPlease refer the following link to setup SonarQube in your machine.
After a project has been setup you will get a command that looks like below, which one much execute in the root dir of that respective project to run the analysis.
sonar-scanner \
-Dsonar.projectKey={{<PROJECTKEY>}} \
-Dsonar.sources=. \
-Dsonar.host.url={{<URL_WHERE_SONARQUBE_IS_HOSTED>}} \
-Dsonar.token={{<TOKEN FOR THE PROJECT>}}