-
Notifications
You must be signed in to change notification settings - Fork 0
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
9fbb661
commit 23c29a0
Showing
11 changed files
with
1,613 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,2 @@ | ||
node_modules | ||
README.md |
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 @@ | ||
node_modules |
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,2 @@ | ||
# Email service using Nodemailer AMQP | ||
### References: https://github.com/nodemailer/nodemailer-amqp-example |
Empty file.
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,9 @@ | ||
{ | ||
"amqp": "amqp://localhost", | ||
"queue": "nodemailer-amqp", | ||
|
||
"server": { | ||
"port": 12345, | ||
"host": "localhost" | ||
} | ||
} |
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,29 @@ | ||
const winston = require("winston"); | ||
const config = require("./config"); | ||
|
||
const enumerateErrorFormat = winston.format((info) => { | ||
if (info instanceof Error) { | ||
Object.assign(info, { message: info.stack }); | ||
} | ||
return info; | ||
}); | ||
|
||
const logger = winston.createLogger({ | ||
level: "info", | ||
format: winston.format.combine( | ||
enumerateErrorFormat(), | ||
config.env === "development" | ||
? winston.format.colorize() | ||
: winston.format.uncolorize(), | ||
winston.format.errors({ stack: true }), | ||
winston.format.json() | ||
), | ||
defaultMeta: { application: "mail_service" }, | ||
transports: [ | ||
new winston.transports.Console({ | ||
format: winston.format.simple(), | ||
}), | ||
], | ||
}); | ||
|
||
module.exports = logger; |
Oops, something went wrong.