Skip to content

Commit b6868ff

Browse files
committed
minor
1 parent f4a8963 commit b6868ff

File tree

6 files changed

+8798
-17
lines changed

6 files changed

+8798
-17
lines changed

INSTALL.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Also it's recommended to add this line to `/etc/hosts`:
104104

105105
This host name is in the Nginx config already.
106106

107-
## 7.1. Если Nginx у вас уже стоит
107+
## 7.1. If node.js is installed already
108108

109109
If you already have nginx, make a backup of it's config files.
110110

@@ -143,13 +143,13 @@ That requires to setup a plnkr session, and is not necessary to run the tutorial
143143

144144
Run the site with the language in `NODE_LANG` variable:
145145
```
146-
HOST=127.0.0.1 PORT=80 NODE_LANG=en ./dev
146+
HOST=127.0.0.1 PORT=80 ./dev en
147147
```
148148

149149
Or with default host 127.0.0.1 and port 3000:
150150

151151
```
152-
NODE_LANG=en ./dev
152+
./dev en
153153
```
154154

155155
Then access the site.
@@ -161,7 +161,7 @@ If you have `127.0.0.1 javascript.in` in `/etc/hosts`, then the address will be
161161
In "Edit" mode the engine watches the tutorial directory, instantly picks the changes and reloads the page. Good for editing.
162162

163163
```
164-
PLUNK_REMOTE_OFF=1 NODE_LANG=en ./edit
164+
./edit en
165165
```
166166

167167
This uses the default `HOST=127.0.0.1`, `PORT=3000`, and the folder is `/js/javascript-tutorial-en`.

dev

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
11
#!/bin/bash
22

3-
ASSET_VERSIONING=query NODE_ENV=development WATCH=1 npm --silent run gulp dev | bunyan -o short -l debug
3+
: ${1?"Usage: $0 <language>"}
4+
5+
set -e
6+
7+
export NODE_LANG=$1
8+
export NODE_ENV=development
9+
export ASSET_VERSIONING=query
10+
export WATCH=1
11+
export SITE_HOST=http://javascript.in
12+
npm --silent run gulp dev | bunyan -o short -l debug
13+

edit

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
#!/bin/bash
22

3+
: ${1?"Usage: $0 <language>"}
4+
35
BRANCH="${1:-$NODE_LANG}"
46

57
export NODE_LANG=$BRANCH
68
export NODE_ENV=production
79
export TUTORIAL_EDIT=1
10+
export PLUNK_REMOTE_OFF=1
811

912
npm --silent run -- gulp tutorial:import --root /js/javascript-tutorial-$BRANCH
1013
npm --silent run -- gulp edit --root /js/javascript-tutorial-$BRANCH

modules/config/mongoose.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1+
let host = process.env.MONGO_HOST || 'localhost';
2+
let db = process.env.NODE_ENV == 'test' ? "js_test" : `js_${process.env.NODE_LANG}`;
3+
14
module.exports = {
2-
"uri": "mongodb://localhost/" + (
3-
process.env.NODE_ENV == 'test' ? "js_test" : `js_${process.env.NODE_LANG}`
4-
),
5-
"options": {
6-
"server": {
7-
"socketOptions": {
8-
"keepAlive": 1
9-
},
10-
"poolSize": 5
11-
}
5+
uri: 'mongodb://' + host + "/" + db,
6+
options: {
7+
keepAlive: true,
8+
reconnectTries: 10,
9+
socketTimeoutMS: 10000,
10+
connectTimeoutMS: 10000,
11+
poolSize: 5,
12+
promiseLibrary: global.Promise
1213
}
1314
};
1415

0 commit comments

Comments
 (0)