{"size": 564, "ext": "js", "max_stars_repo_path": "Node_CZ/NodeJS03/08_middleware04_use.js", "max_stars_repo_name": "Rain-NodeJS/Node.js_CZ", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "Node_CZ/NodeJS03/08_middleware04_use.js", "max_issues_repo_name": "Rain-NodeJS/Node.js_CZ", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "Node_CZ/NodeJS03/08_middleware04_use.js", "max_forks_repo_name": "Rain-NodeJS/Node.js_CZ", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 17.0909090909, "max_line_length": 68, "alphanum_fraction": 0.585106383}

var express = require('express');

var app = express();

app.use('/', function (req, res, next) {
  var date = new Date();
  res.write(date.toDateString());
  next();
});


// http://localhost:3000/admin/aa/bb/cc
app.use('/admin', function (req, res) {

  res.writeHead(200, {'Content-Type': 'text/plain; charset=utf-8'});
  res.write(req.originalUrl + '\n'); //  /admin/aa/bb/cc

  res.write(req.baseUrl + '\n');//    /admin

  res.write(req.path + '\n'); //   /aa/bb/cc

  res.end('你好');
});





app.listen(3000, function () {
  console.log('监听端口号: 3000');
})
