Explorar el Código

Add request count function to test server

Ben Hsieh hace 9 años
padre
commit
d4b11948ea
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2
    1
      test-server/server.js

+ 2
- 1
test-server/server.js Ver fichero

40
     console.log('test server running at port ',8123)
40
     console.log('test server running at port ',8123)
41
 })
41
 })
42
 
42
 
43
+var count = 0
43
 
44
 
44
 app.use(function(req,res,next){
45
 app.use(function(req,res,next){
45
-  console.log(chalk.green('request url=') + chalk.magenta(req.url))
46
+  console.log(chalk.green('request url=') + chalk.magenta(req.url), ++count)
46
   next()
47
   next()
47
 })
48
 })
48
 
49