|
|
|
211 . Ru, Eng, Fra, Esp, Ukr. |
|
|
|
|
|
|
 |
|
Jade-
doctype 5
html(lang="en")
head
title Zowie! Top Scores
meta(charset="utf-8")
| <-- style type="text/css">
include main.css
| <--/style> body
table
caption Zowie! Top Scorers!
tr
th Score
th Name
th Date
if scores.length
each score in scores
if score
tr
td #{score.score}
td #{score.first_name} #{score.last_name}
td #{score.date}
( , ), :
var layout = require('fs').readFileSync(__dirname + '/score.jade', 'utf8');
var fn = jade.compile(layout, {filename: __dirname + '/score.jade'});
Jade- , HTML- , , :
var str = fn({scores : result});
res.end(str);
, , Redis- . Redis-: zrevrange , hgetall - , . .
, , Redis, . , Node-, Redis- .
Async, 5, Async-: waterfall parallel. series, . Redis- , , . parallel Async , , , . waterfall , . Async- series , Redis- hgetall , , .
, Redis- , , : Async- series Redis- hgetall , . 5 , , 10 100 ? Redis- Async- series , .
, Redis- zrevrange, makeCallbackFunc. , Redis- hgetall, , Async, . , makeCallbackFunc, , , Async- series. , redis hgetall , Async- series, , , , , .
. , , , Redis Async .
, , .
, . .
|