我使用connect和nowjs成功配置了节点。调用localhost:8001 / test.html和localhost:8001 / chat.html可以正常工作。但是当调用PHP文件localhost:8001 / test.php时,我的浏览器要我下载该文件。显然connect.static不会解释PHP文件。有没有其他可能让它适用于HTML和PHP文件? 感谢
var http = require('http');
var connect = require('connect');
var nowjs = require("now");
var app = connect();
app.use(connect.static('/var/www/www.domain.com/htdocs'));
app.use(function(req, res){
res.end();
});
var server = http.createServer(app).listen(8001);
var everyone = nowjs.initialize(server);