Skip to content

Commit

Permalink
emacs formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
liangzan committed Aug 28, 2011
1 parent d595361 commit 9ef2d1e
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions app.js
Expand Up @@ -19,7 +19,7 @@ var app = module.exports = express.createServer(
// Configuration // Configuration
app.configure(function(){ app.configure(function(){
app.set('views', __dirname + '/views'); app.set('views', __dirname + '/views');
// app.set('views', __dirname + '/public'); // app.set('views', __dirname + '/public');
app.set('view engine', 'jade'); app.set('view engine', 'jade');
app.use(express.bodyParser()); app.use(express.bodyParser());
app.use(express.methodOverride()); app.use(express.methodOverride());
Expand Down Expand Up @@ -64,15 +64,15 @@ app.post('/', function (req, res, next) {
var jsonCounter = JSON.parse(fileContents); var jsonCounter = JSON.parse(fileContents);
var counter = jsonCounter.counter; var counter = jsonCounter.counter;
counter++; counter++;
logger.debug("counter:" + counter) logger.debug("counter:" + counter);
logger.debug(counter); logger.debug(counter);
fs.writeFileSync(fileCounter, '{ "counter": ' + counter + ' }'); fs.writeFileSync(fileCounter, '{ "counter": ' + counter + ' }');


// move the file from the temp to permanent dir // move the file from the temp to permanent dir
var audioFileName = counter + '.' + ext; var audioFileName = counter + '.' + ext;
var audioFilePath = audioDir + audioFileName; var audioFilePath = audioDir + audioFileName;
var cmd = "mv " + files.audio.path + " " + audioFilePath; var cmd = "mv " + files.audio.path + " " + audioFilePath;
logger.debug("cmd:" + cmd) logger.debug("cmd:" + cmd);


var child = exec(cmd, function(err, stdout, stderr) { var child = exec(cmd, function(err, stdout, stderr) {
if (err) { if (err) {
Expand Down Expand Up @@ -107,11 +107,11 @@ logger.debug("cmd:" + cmd)


app.listen(process.env.NODE_ENV === 'production' ? 80 : 8000, function() { app.listen(process.env.NODE_ENV === 'production' ? 80 : 8000, function() {


// if run as root, downgrade to the owner of this file // if run as root, downgrade to the owner of this file
// if (process.getuid() === 0) // if (process.getuid() === 0)
// require('fs').stat(__filename, function(err, stats) { // require('fs').stat(__filename, function(err, stats) {
// if (err) return console.log(err) // if (err) return console.log(err)
// process.setuid(stats.uid); // process.setuid(stats.uid);
// }); // });
}); });
console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env); console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env);

0 comments on commit 9ef2d1e

Please sign in to comment.