for #17: more REDME updates
This commit is contained in:
Родитель
af7aa093fe
Коммит
ffadbaa08d
16
README.md
16
README.md
|
@ -18,13 +18,13 @@ cases.
|
|||
## Development
|
||||
### Requirements
|
||||
|
||||
* [node](https://nodejs.org/) (with npm)
|
||||
* [node](https://nodejs.org/) 8 (with npm)
|
||||
|
||||
### Install
|
||||
|
||||
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
|
||||
|
||||
2. Install dependencies:
|
||||
|
@ -37,14 +37,12 @@ cases.
|
|||
|
||||
### Run
|
||||
|
||||
1. Source the `.env` file to set required environment variables:
|
||||
|
||||
source .env
|
||||
|
||||
2. Run the server:
|
||||
1. Run the server:
|
||||
|
||||
node server.js
|
||||
|
||||
2. Visit the `test.html` page at [localhost:6060/test.html](http://localhost:6060/test.html)
|
||||
|
||||
#### 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:
|
||||
```
|
||||
export DEBUG_DUMMY_SMTP=0
|
||||
export DEBUG_DUMMY_SMTP=
|
||||
export SMTP_HOST=<your-smtp-host>
|
||||
export SMTP_PORT=<your-smtp-port>
|
||||
export SMTP_USERNAME=<your-username>
|
||||
export SMTP_PASSWORD=<your-password
|
||||
export SMTP_PASSWORD=<your-password>
|
||||
```
|
||||
|
||||
#### Firefox Accounts
|
||||
|
|
12
server.js
12
server.js
|
@ -203,12 +203,12 @@ if (process.env.DEBUG_DUMMY_SMTP) {
|
|||
console.log("Attempting to get SMTP config from environment...");
|
||||
kSMTPUsername = process.env.SMTP_USERNAME;
|
||||
let password = process.env.SMTP_PASSWORD;
|
||||
let SMTP_host = process.env.SMTP_HOST;
|
||||
let SMTP_port = process.env.SMTP_PORT;
|
||||
if (kSMTPUsername && password) {
|
||||
let host = process.env.SMTP_HOST;
|
||||
let port = process.env.SMTP_PORT;
|
||||
if (kSMTPUsername && password && host && port) {
|
||||
gTransporter = nodemailer.createTransport({
|
||||
host: SMTP_host,
|
||||
port: SMTP_port,
|
||||
host: host,
|
||||
port: port,
|
||||
secure: true,
|
||||
auth: {
|
||||
user: kSMTPUsername,
|
||||
|
@ -225,7 +225,7 @@ if (process.env.DEBUG_DUMMY_SMTP) {
|
|||
}
|
||||
|
||||
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() {
|
||||
console.log("Listening on " + port);
|
||||
|
|
Загрузка…
Ссылка в новой задаче