0.0.4 • Published 11 years ago

pjs-node v0.0.4

Weekly downloads
21
License
-
Repository
github
Last release
11 years ago

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..

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago