pjs-node
v0.0.4
Published
Template wrapper for hogan - mustache to allow php style templates
Downloads
9
Readme
pjs-node
Here was the problem.. I want templates that will work in both PHP and NodeJS-ExpressJS..
I like to template in PHP the simple way.. like this..
<?
$s = "World"
?>
Hello <?=$s?>
Now this template can be used in Express like this..
var app = require('express')();
require('./pjs-node.js')(app);
app.all('*', function(q, s) {
s.render('index', {what:'World!'})
})
Templates have an .pjs extension and default in the app directory (not /views).
This and the port can be changed like so...
require('./pjs-node.js')(app, '/views', 80);
This module will start the server also (default port = 3000) just to reduce my test.js/app.js size..
See test.js for example..