我是一個初學者的節點,只是想使用Jade模板引擎,我讀了GitHub頁面上的ReadMe,並且我最終認爲這應該是工作:試圖瞭解如何使用Jade與Node.js
var http = require('http'),
jade = require('jade'),
fn = jade.compile('html p hello');
function onRequest(req, res) {
res.writeHead(200, {"Content-Type": "text/html"});
res.write('Hello World!');
fn;
res.end();
}
http.createServer(onRequest).listen(8888);
console.log('Server started.');
但它不,可能有人向我解釋什麼,我做錯了什麼?非常感謝!
這不是autamagic,你必須在迴應中編寫玉石 –