This commit is contained in:
groovecoder 2018-02-05 13:47:41 -06:00
Родитель af7aa093fe
Коммит ffadbaa08d
2 изменённых файлов: 13 добавлений и 15 удалений

Просмотреть файл

@ -18,13 +18,13 @@ cases.
## Development ## Development
### Requirements ### Requirements
* [node](https://nodejs.org/) (with npm) * [node](https://nodejs.org/) 8 (with npm)
### Install ### Install
1. clone and change to the directory: 1. clone and change to the directory:
git clone https://github.com/nhnt11/blurts-server.git git clone https://github.com/mozilla/blurts-server.git
cd blurts-server cd blurts-server
2. Install dependencies: 2. Install dependencies:
@ -37,14 +37,12 @@ cases.
### Run ### Run
1. Source the `.env` file to set required environment variables: 1. Run the server:
source .env
2. Run the server:
node server.js node server.js
2. Visit the `test.html` page at [localhost:6060/test.html](http://localhost:6060/test.html)
#### Emails #### Emails
The included `.env-dist` sets `DEBUG_DUMMY_SMTP=1` which disables emails. The included `.env-dist` sets `DEBUG_DUMMY_SMTP=1` which disables emails.
@ -54,11 +52,11 @@ config values for sending email.
You can set and source these via the `.env` file, or set them directly: You can set and source these via the `.env` file, or set them directly:
``` ```
export DEBUG_DUMMY_SMTP=0 export DEBUG_DUMMY_SMTP=
export SMTP_HOST=<your-smtp-host> export SMTP_HOST=<your-smtp-host>
export SMTP_PORT=<your-smtp-port> export SMTP_PORT=<your-smtp-port>
export SMTP_USERNAME=<your-username> export SMTP_USERNAME=<your-username>
export SMTP_PASSWORD=<your-password export SMTP_PASSWORD=<your-password>
``` ```
#### Firefox Accounts #### Firefox Accounts

Просмотреть файл

@ -203,12 +203,12 @@ if (process.env.DEBUG_DUMMY_SMTP) {
console.log("Attempting to get SMTP config from environment..."); console.log("Attempting to get SMTP config from environment...");
kSMTPUsername = process.env.SMTP_USERNAME; kSMTPUsername = process.env.SMTP_USERNAME;
let password = process.env.SMTP_PASSWORD; let password = process.env.SMTP_PASSWORD;
let SMTP_host = process.env.SMTP_HOST; let host = process.env.SMTP_HOST;
let SMTP_port = process.env.SMTP_PORT; let port = process.env.SMTP_PORT;
if (kSMTPUsername && password) { if (kSMTPUsername && password && host && port) {
gTransporter = nodemailer.createTransport({ gTransporter = nodemailer.createTransport({
host: SMTP_host, host: host,
port: SMTP_port, port: port,
secure: true, secure: true,
auth: { auth: {
user: kSMTPUsername, user: kSMTPUsername,
@ -225,7 +225,7 @@ if (process.env.DEBUG_DUMMY_SMTP) {
} }
if (!gTransporter) { if (!gTransporter) {
console.log("SMTP config unavailble. Email features will not work.") console.log("SMTP config unavailable. Email features will not work.")
} }
app.listen(port, function() { app.listen(port, function() {
console.log("Listening on " + port); console.log("Listening on " + port);