Created
February 17, 2011 05:26
-
-
Save samholmes/831037 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ReferenceError: module is not defined | |
at IncomingMessage.anonymous (eval at <anonymous> (/usr/local/lib/node/.npm/ejs/0.3.0/package/lib/ejs/index.js:139:14)) | |
at IncomingMessage.<anonymous> (/usr/local/lib/node/.npm/ejs/0.3.0/package/lib/ejs/index.js:141:19) | |
at Object.render (/usr/local/lib/node/.npm/ejs/0.3.0/package/lib/ejs/index.js:176:13) | |
at ServerResponse.render (/usr/local/lib/node/.npm/express/1.0.7/package/lib/express/view.js:334:22) | |
at ServerResponse.partial (/usr/local/lib/node/.npm/express/1.0.7/package/lib/express/view.js:200:17) | |
at Object.<anonymous> (/usr/local/lib/node/.npm/express/1.0.7/package/lib/express/view.js:311:25) | |
at IncomingMessage.anonymous (eval at <anonymous> (/usr/local/lib/node/.npm/ejs/0.3.0/package/lib/ejs/index.js:139:14)) | |
at IncomingMessage.<anonymous> (/usr/local/lib/node/.npm/ejs/0.3.0/package/lib/ejs/index.js:141:19) | |
at Object.render (/usr/local/lib/node/.npm/ejs/0.3.0/package/lib/ejs/index.js:176:13) | |
at ServerResponse.render (/usr/local/lib/node/.npm/express/1.0.7/package/lib/express/view.js:334:22) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var util = require('util'); | |
var url = require('url'); | |
var express = require('express'); | |
var app = express.createServer(); | |
app.configure(function(){ | |
app.set('views', __dirname + '/views'); | |
app.set('view engine', 'ejs'); | |
app.set('view options', { | |
open: '<<', | |
close: '>>' | |
}); | |
app.use(express.cookieDecoder()); | |
app.use(require('sesame')()); | |
app.dynamicHelpers({ | |
req: function(req, res) { | |
return req; | |
}, | |
res: function(req, res) { | |
return res; | |
}, | |
base: function(req, res) { | |
return 'http://'+req.headers.host+url.parse(req.url).pathname | |
}, | |
session: function(req, res) { | |
return req.session; | |
} | |
}); | |
}); | |
app.get('/', require('./controllers/home.js')); | |
app.listen(3000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<noscript> | |
<div class="error"> | |
This site requires JavaScript in order to be used properly. Please enable JavaScript in your web browser. | |
</div> | |
</noscript> | |
<div id="header"> | |
<a id="logo" href="<<- base >>"> | |
<img src="images/global/header/logo.png" alt="Prosper Page"/> | |
</a> | |
<< | |
if (req.session) | |
{ | |
if (req.session.login) | |
{ | |
>> | |
<div id="header-login-controls"> | |
<a href="account/">Account</a> | | |
<a href="login.php?logout">Logout</a> | |
</div> | |
<< | |
} | |
else | |
{ | |
>> | |
<div id="header-login-form"> | |
<form method="post" action="login.php"> | |
<label for="login-email">Email</label> | |
<input type="text" class="text" id="login-email" name="email"/> | |
<label for="login-password">Password</label> | |
<input type="password" class="password" id="login-password" name="password"/> | |
<input type="submit" class="button" name="submit" value="Login"/> | |
</form> | |
<< | |
if (module.parent.filename != "/affiliate/index.php") | |
{ | |
>> | |
<a id="affiliate-page-link" href="affiliate/">Join our affiliate program!</a> | |
<< | |
} | |
>> | |
</div> | |
<< | |
} | |
} | |
>> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<<- partial('header') >> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang='en'> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/> | |
<title><<- typeof title == 'undefined' ? "Default Title" : title >></title> | |
<base href="<<- base >>"> | |
<link rel='shortcut icon' href='favicon.ico'/> | |
<< | |
// JavaScript Imports | |
if (typeof css != 'undefined') { | |
css.forEach(function(ele){ | |
>> | |
<link rel='stylesheet' type='text/css' href='<<- ele >>'/> | |
<< | |
}); | |
} | |
// StyleSheet Imports | |
if (typeof js != 'undefined') { | |
js.forEach(function(ele) { | |
>> | |
<script type='text/javascript' src='<<- ele >>'></script> | |
<< | |
}); | |
} | |
>> | |
</head> | |
<body> | |
<div id='wrapper'> | |
<<- body >> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment