Permalink
Browse files

[api] Default root is ./public if it exists, ./ otherwise

  • Loading branch information...
1 parent 44f9fe9 commit ef02dab825bde8a531e3d40d391760784ddd12c8 @jfhbrook jfhbrook committed Nov 26, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/http-server.js
View
@@ -7,7 +7,7 @@ var flatiron = require('flatiron'),
var server = module.exports;
var opts = {
- root: argv._[0] || "./public",
+ root: argv._[0] || (path.existsSync("./public") ? "./public" : "./"),
port: argv.p || 8080,
host: argv.a || 'localhost',
cache: argv.c || 3600, // in seconds.

0 comments on commit ef02dab

Please sign in to comment.