Permalink
Browse files

Regenerate example

  • Loading branch information...
1 parent 04acac2 commit 055e744e7e368e2cf3ddbb2585561819ba7361ae @cqql cqql committed Mar 25, 2013
View
@@ -1,14 +1,14 @@
-var express = require('express'),
- jade = require('jade'),
- fs = require('fs'),
- toAmdString = require('../lib/jade-amd').toAmdString,
- jadeRuntimeAmdString = require('../lib/jade-amd').jadeRuntimeAmdString,
- jadeAmdMiddleware = require('../lib/jade-amd').jadeAmdMiddleware;
+var express = require('express'),
+ jade = require('jade'),
+ fs = require('fs'),
+ toAmdString = require('../lib/jade-amd').toAmdString,
+ jadeRuntimeAmdString = require('../lib/jade-amd').jadeRuntimeAmdString,
+ jadeAmdMiddleware = require('../lib/jade-amd').jadeAmdMiddleware;
var app = module.exports = express.createServer();
-app.configure(function(){
+app.configure(function () {
app.use(express.logger('dev'));
app.set('view engine', 'jade');
app.set('views', __dirname + '/views');
@@ -17,50 +17,50 @@ app.configure(function(){
app.use(express.methodOverride());
app.use(express.favicon());
- // In this example we'll use a boolean variable to decide what mode to run in.
- // In a proper app you'd probably decide this in a more felxible way - in a
+ // In this example we'll use a boolean variable to decide what mode to run in.
+ // In a proper app you'd probably decide this in a more felxible way - in a
// `config` file for example.
var inDev = app.settings.env == 'development';
- // Trap all the requests for compiled templates and serve them from the jade
- // on disk. The first argument is where this middleware is mounted - and
+ // Trap all the requests for compiled templates and serve them from the jade
+ // on disk. The first argument is where this middleware is mounted - and
// should match the path to the template files used from the browser.
//
- // By default it looks in the app.set('views') directory for the templates.
- // Put this BEFORE the `static` middleware or it will serve the javascript
+ // By default it looks in the app.set('views') directory for the templates.
+ // Put this BEFORE the `static` middleware or it will serve the javascript
// instead.
if (inDev) {
- app.use( '/js/templates/', jadeAmdMiddleware({}) );
+ app.use('/js/templates/', jadeAmdMiddleware({}));
}
- // Choose which directory to serve static assets from. When developing use
- // 'public' which has all the individual files in. When not developing (ie
- // production or testing) use the output from the build process - which
+ // Choose which directory to serve static assets from. When developing use
+ // 'public' which has all the individual files in. When not developing (ie
+ // production or testing) use the output from the build process - which
// minifies and combines all the files together.
- var publicDir = __dirname + '/public';
+ var publicDir = __dirname + '/public';
var publicMinifiedDir = __dirname + '/public-minified';
- app.use(express.static( inDev ? publicDir : publicMinifiedDir ));
+ app.use(express.static(inDev ? publicDir : publicMinifiedDir));
app.use(app.router);
app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
});
-app.get('/', function (req,res) {
-
+app.get('/', function (req, res) {
+
fs.readFile(
__dirname + '/views/sample.jade',
- function(err, sampleJade) {
+ function (err, sampleJade) {
if (err) throw err;
- var sampleFunction = jade.compile(sampleJade, {client: true, compileDebug: false })
+ var sampleFunction = jade.compile(sampleJade, {client: true, compileDebug: false })
res.locals({
- sampleJade : sampleJade,
- sampleHTML : jade.compile(sampleJade)({}),
- sampleFunction : sampleFunction.toString(),
- sampleAMD : toAmdString(sampleFunction),
+ sampleJade: sampleJade,
+ sampleHTML: jade.compile(sampleJade)({}),
+ sampleFunction: sampleFunction.toString(),
+ sampleAMD: toAmdString(sampleFunction),
jadeRuntimeAmdString: jadeRuntimeAmdString,
});
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 055e744

Please sign in to comment.