Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Try to serve index.html with -d option

  • Loading branch information...
commit 346c0dbf9ad3173c554689de803579101dc64275 1 parent 0fcfc17
@mjackson authored
Showing with 9 additions and 9 deletions.
  1. +9 −9 bin/strata
View
18 bin/strata
@@ -115,15 +115,9 @@ 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 () {
@@ -131,6 +125,12 @@ if (options.reload) {
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();
}
Please sign in to comment.
Something went wrong with that request. Please try again.