I use node.js 0.10.12 and express.js 4.2.0
I want to set the app.engine
to render complex html files, files that contain javascript and/or php functions.
I tried Drew Noakes's answer here, but nothing. In my case I have
app.set('views', './views');
app.engine('html', require('jade').renderFile);
app.get('/', function(req, res) {
res.render('qs.html');
});
And when I visit the page, I get
SyntaxError: views\qs.html:27 25| <p>the hash has to be always to the end of the url, to be well-defined.<br> 26| sometimes when i click to add the hash first and then the query string, the page does not reload and the query string is added after the hash, wich are both wrong</p>
> 27| =============================<br> 28| <button name="hey1" onClick="historytestindex();">history test index</button> 29| <button name="hey2" onClick="historytestajaxtwo();">history test ajaxtwo</button> 30| <button name="hey3" onClick="historytestajaxfour();">history test ajaxfour</button> Unexpected token === at Function (<anonymous>) at assertExpression (C:\Program Files (x86)\nodejs\secondtest\node_modules\jade\lib\lexer.js:30:3) at Object.Lexer.code (C:\Program Files (x86)\nodejs\secondtest\node_modules\jade\lib\lexer.js:570:23) at Object.Lexer.next (C:\Program Files (x86)\nodejs\secondtest\node_modules\jade\lib\lexer.js:864:15) at Object.Lexer.lookahead (C:\Program Files (x86)\nodejs\secondtest\node_modules\jade\lib\lexer.js:113:46) at Parser.lookahead (C:\Program Files (x86)\nodejs\secondtest\node_modules\jade\lib\parser.js:100:23) at Parser.peek (C:\Program Files (x86)\nodejs\secondtest\node_modules\jade\lib\parser.js:77:17) at Parser.tag (C:\Program Files (x86)\nodejs\secondtest\node_modules\jade\lib\parser.js:791:30) at Parser.parseTag (C:\Program Files (x86)\nodejs\secondtest\node_modules\jade\lib\parser.js:719:17) at Parser.parseExpr (C:\Program Files (x86)\nodejs\secondtest\node_modules\jade\lib\parser.js:188:21)
I guess it finds syntax errors, but I dont why, since I paired html with jade.
Please, there is got to be a way to render complex html+js+php files with node+express.
Thanks