This file contains hidden or 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
// Routes | |
// General routes | |
app.all( '/remote(/*)?', Security.simple_auth ); | |
app.all( '/presenter(/*)?', Security.simple_auth ); | |
// General User | |
app.get( '/', function( req, res ) { | |
res.render( 'presentation/node', { | |
title: 'Node - PEEEYYYAAAAAHHH' | |
}); |
This file contains hidden or 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 PI = Math.PI; | |
exports.area = function (r) { | |
return PI * r * r; | |
}; | |
exports.circumference = function (r) { | |
return 2 * PI * r; | |
}; |
This file contains hidden or 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 fs = require('fs'); | |
fs.readdir('.', function (err, files) { | |
if (err) throw err; | |
for (var index in files) { | |
console.log(files[index]); | |
} | |
}); |
This file contains hidden or 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
$.get('ajax/test.html', function(data) { | |
$('.result').html(data); | |
alert('Load was performed.'); | |
}); |
This file contains hidden or 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 sys = require('sys'), | |
http = require('http'); | |
http.createServer(function(req, res) { | |
res.writeHead(200, {'Content-Type': 'text/html'}); | |
res.write('<p>Hello World</p>'); | |
res.end(); | |
}).listen(8080); |
NewerOlder