Permalink
Browse files

Try to serve index.html with -d option

  • Loading branch information...
1 parent 0fcfc17 commit 346c0dbf9ad3173c554689de803579101dc64275 @mjackson committed Oct 16, 2012
Showing with 9 additions and 9 deletions.
  1. +9 −9 bin/strata
View
18 bin/strata
@@ -115,22 +115,22 @@ if (options.reload) {
child.exit();
});
} else {
- if (options.appFile) {
- try {
- strata.run(require(options.appFile), options);
- } catch (e) {
- console.log('Error: ' + e.message);
- }
- } else if (options.dir) {
- var app = strata.file(utils.notFound, options.dir);
- app = strata.directory(app, options.dir);
+ if (options.dir) {
+ var app = strata.directory(app, options.dir);
+ app = strata.file(utils.notFound, options.dir, 'index.html');
app = strata.commonLogger(app);
strata.run(app, options, function () {
if (!options.quiet) {
console.log('>> Serving directory ' + options.dir);
}
});
+ } else if (options.appFile) {
+ try {
+ strata.run(require(options.appFile), options);
+ } catch (e) {
+ console.log('Error: ' + e.message);
+ }
} else {
printUsage();
}

0 comments on commit 346c0db

Please sign in to comment.