1.路由实现方式和顺序 express框架创建的模板app,js中默认代码 var express = require('express'); var routes = require('./routes'); var user = require('./routes/user'); var http = require('http'); var path = require('path'); var app = express(); // all environments app.set('p…
var http = require("http"); var url = require("url"); var ejs = require("ejs"); var querystring = require("querystring"); var server = http.createServer(function(req,res){ res.writeHead(200,{"content-type"…