File tree Expand file tree Collapse file tree 6 files changed +178
-180
lines changed
5-network/08-xmlhttprequest Expand file tree Collapse file tree 6 files changed +178
-180
lines changed Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ function accept(req, res) {
43
43
44
44
45
45
46
- // ----- запуск accept как сервера из консоли или как модуля ------
46
+ // ----- avvia il server ------
47
47
48
48
if ( ! module . parent ) {
49
49
http . createServer ( accept ) . listen ( 8080 ) ;
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ var file = new static.Server('.', {
10
10
function accept ( req , res ) {
11
11
12
12
if ( req . url == '/phones.json' ) {
13
- // искусственная задержка для наглядности
13
+ // va un pochino in stallo per permettere di mostrare il messaggio di "loading"
14
14
setTimeout ( function ( ) {
15
15
file . serve ( req , res ) ;
16
16
} , 2000 ) ;
@@ -21,7 +21,7 @@ function accept(req, res) {
21
21
}
22
22
23
23
24
- // ------ запустить сервер -------
24
+ // ------ avvia il server -------
25
25
26
26
if ( ! module . parent ) {
27
27
http . createServer ( accept ) . listen ( 8080 ) ;
Original file line number Diff line number Diff line change 15
15
xhr . send ( ) ;
16
16
17
17
if ( xhr . status != 200 ) {
18
- // handle error
18
+ // gestisce l'errore
19
19
alert ( 'Error ' + xhr . status + ': ' + xhr . statusText ) ;
20
20
} else {
21
- // show result
21
+ // mostra il risultato
22
22
alert ( xhr . responseText ) ;
23
23
}
24
24
}
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ let file = new static.Server('.', {
10
10
function accept ( req , res ) {
11
11
12
12
if ( req . url == '/phones.json' ) {
13
- // stall a bit to let "loading" message show up
13
+ // va un pochino in stallo per permettere di mostrare il messaggio di "loading"
14
14
setTimeout ( function ( ) {
15
15
file . serve ( req , res ) ;
16
16
} , 2000 ) ;
@@ -21,7 +21,7 @@ function accept(req, res) {
21
21
}
22
22
23
23
24
- // ------ запустить сервер -------
24
+ // ------ avvia il server -------
25
25
26
26
if ( ! module . parent ) {
27
27
http . createServer ( accept ) . listen ( 8080 ) ;
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ function accept(req, res) {
17
17
chunks . push ( data ) ;
18
18
length += data . length ;
19
19
20
- // More than 10mb, kill the connection !
20
+ // Per un contenuto maggiore di 10mb, termina la connessione !
21
21
if ( length > 1e8 ) {
22
22
req . connection . destroy ( ) ;
23
23
}
@@ -49,7 +49,7 @@ function accept(req, res) {
49
49
}
50
50
51
51
52
- // ------ запустить сервер -------
52
+ // ------ avvia il server -------
53
53
54
54
if ( ! module . parent ) {
55
55
http . createServer ( accept ) . listen ( 8080 ) ;
You can’t perform that action at this time.
0 commit comments