下载 express 不用多说了
然后是express-partials 这个是用来支持ejs模版的
好了下载安装后 就是程序了
var express = require("express")
, path = require('path')
, partials = require("express-partials")
var app = express();
app.use(partials()); ///注意,这个一定要在app.use(app.router)之前
app.listen(8000);
app.configure(function () {
app.set('views', __dirname + '/views');
app.set('view engine', 'ejs');
app.use(express.favicon());
app.use(express.logger('dev'));
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(app.router);
app.use(express.static(path.join(__dirname, '/public')));
});