が含まれますツールボックスによると、すべてが動作するはずですのNode.jsのEJSは、私は、このテンプレートを作成しておりますエラー
app.js:
var http = require('http');
var ejs = require('ejs');
var fs = require('fs')
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/xml'});
fs.readFile('placemark.ejs', 'utf8', function (err, template) {
var content = ejs.render(template,{
name:"test name",
description:"this is the description",
coordinates:"-122.0822035425683,37.42228990140251,0"
});
res.write(content);
res.end()
});
}).listen(8000);
console.log('Server listening at at xxxxxxxx');
私は他のテンプレートから構築したテンプレートを、レンダリングEJSを使用。 ejs-localsを使うと、メソッドレンダリングがないと言います。 「ejs」だけでこれを行う方法はありますか?ここで
はどのバージョンejsと表現のあなたは使用していますか?これは正しいと私が使用するものです。 https://github.com/visionmedia/ejs – chovy
/ホーム/ justas ├──[email protected] ├─┬[email protected]それは認識しない – sauletasmiestas