This repository has been archived by the owner on Apr 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
303407c
commit 59b3669
Showing
4 changed files
with
41 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@staart/manager", | ||
"version": "1.3.14", | ||
"version": "1.3.15", | ||
"main": "index.js", | ||
"repository": "[email protected]:staart/api.git", | ||
"author": "Anand Chowdhary <[email protected]>", | ||
|
@@ -125,5 +125,5 @@ | |
"setup" | ||
], | ||
"snyk": true, | ||
"staart-version": "1.3.14" | ||
"staart-version": "1.3.15" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { TEST_EMAIL } from "./config"; | ||
import { logError, success } from "@staart/errors"; | ||
import { sendMail, setupTransporter } from "@staart/mail"; | ||
import systemInfo from "systeminformation"; | ||
import pkg from "../package.json"; | ||
import redis from "@staart/redis"; | ||
|
||
redis | ||
.set(pkg.name, systemInfo.time().current) | ||
.then(() => redis.del(pkg.name)) | ||
.then(() => success("Redis is listening")) | ||
.catch(() => logError("Redis", "Unable to connect")); | ||
|
||
setupTransporter(); | ||
|
||
if (process.env.NODE_ENV === "production") | ||
sendMail({ | ||
to: TEST_EMAIL, | ||
subject: "Test from Staart", | ||
message: `This is an example email to test your Staart email configuration.\n\n${JSON.stringify( | ||
{ | ||
time: systemInfo.time(), | ||
package: { | ||
name: pkg.name, | ||
version: pkg.version, | ||
repository: pkg.repository, | ||
author: pkg.author, | ||
"staart-version": pkg["staart-version"] | ||
} | ||
} | ||
)}` | ||
}) | ||
.then(() => {}) | ||
.catch(() => | ||
logError("Invalid email config", "Could not send a test email", 1) | ||
); |