Вход

Просмотр полной версии : Как отрендерить шаблон


sash003
02.06.2017, 18:07
Привет. Я с ума сойду с этой нодой..

Audaxviator
02.06.2017, 22:34
Вооружиться фреймвёрком Express и написать res.render('шаблон').

ruslan_mart
08.06.2017, 01:32
const http = require('http');

http.createServer(function (req, res) {
var html = buildHtml(req);

res.writeHead(200, {
'Content-Type': 'text/html',
'Content-Length': html.length,
'Expires': new Date().toUTCString()
});
res.end('<div>Test</div>'');

}).listen(5000);