--- .gitignore
+++ .gitignore
... | ... | @@ -18,7 +18,6 @@ |
18 | 18 |
build |
19 | 19 |
class |
20 | 20 |
classes |
21 |
-credentials.json |
|
22 | 21 |
node_modules |
23 | 22 |
npm-debug.log |
24 | 23 |
package-lock.json |
--- public/md/list.md
+++ public/md/list.md
... | ... | @@ -209,7 +209,6 @@ |
209 | 209 |
./nginx/nginx.md |
210 | 210 |
./nginx/php-fpm.md |
211 | 211 |
./nodejs/async.md |
212 |
-./nodejs/credentials.json.sample |
|
213 | 212 |
./nodejs/debug.md |
214 | 213 |
./nodejs/express-session.md |
215 | 214 |
./nodejs/gmail-box.js |
--- public/md/nodejs/express-session.md
+++ public/md/nodejs/express-session.md
... | ... | @@ -10,10 +10,10 @@ |
10 | 10 |
## example setting & use |
11 | 11 |
|
12 | 12 |
```js |
13 |
-var session = require('express-session') |
|
13 |
+const session = require('express-session') |
|
14 | 14 |
|
15 |
-var app = express(); |
|
16 |
-var sess = { |
|
15 |
+const app = express(); |
|
16 |
+const sess = { |
|
17 | 17 |
secret: 'keyboard cat', |
18 | 18 |
resave: true, |
19 | 19 |
saveUninitialized: true, |
--- public/md/nodejs/knex.md
+++ public/md/nodejs/knex.md
... | ... | @@ -11,7 +11,7 @@ |
11 | 11 |
## init |
12 | 12 |
|
13 | 13 |
``` |
14 |
-var knex = require('knex')({ |
|
14 |
+const knex = require('knex')({ |
|
15 | 15 |
client: 'mysql', |
16 | 16 |
connection: { |
17 | 17 |
host : '127.0.0.1', |
--- public/md/nodejs/multer.md
+++ public/md/nodejs/multer.md
... | ... | @@ -2,11 +2,11 @@ |
2 | 2 |
* https://github.com/expressjs/multer |
3 | 3 |
|
4 | 4 |
``` |
5 |
-var express = require('express') |
|
6 |
-var multer = require('multer') |
|
7 |
-var upload = multer({ dest: 'uploads/' }) |
|
5 |
+const express = require('express') |
|
6 |
+const multer = require('multer') |
|
7 |
+const upload = multer({ dest: 'uploads/' }) |
|
8 | 8 |
|
9 |
-var app = express() |
|
9 |
+const app = express() |
|
10 | 10 |
|
11 | 11 |
app.post('/profile', upload.single('avatar'), function (req, res, next) { |
12 | 12 |
// req.file is the `avatar` file |
... | ... | @@ -18,7 +18,7 @@ |
18 | 18 |
// req.body will contain the text fields, if there were any |
19 | 19 |
}) |
20 | 20 |
|
21 |
-var cpUpload = upload.fields([{ name: 'avatar', maxCount: 1 }, { name: 'gallery', maxCount: 8 }]) |
|
21 |
+const cpUpload = upload.fields([{ name: 'avatar', maxCount: 1 }, { name: 'gallery', maxCount: 8 }]) |
|
22 | 22 |
app.post('/cool-profile', cpUpload, function (req, res, next) { |
23 | 23 |
// req.files is an object (String -> Array) where fieldname is the key, and the value is array of files |
24 | 24 |
// |
... | ... | @@ -28,4 +28,4 @@ |
28 | 28 |
// |
29 | 29 |
// req.body will contain the text fields, if there were any |
30 | 30 |
}) |
31 |
-```(No newline at end of file) |
|
31 |
+``` |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?