저는 노드에 초보자인데 비취 엔진 템플릿 엔진을 사용하려고하며 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 아니에요, 당신은 응답에 컴파일 된 옥을 써야만합니다 –