From 776cfa134d9de6f51695ec680f08136ea6326278 Mon Sep 17 00:00:00 2001 From: Jeff Knaggs Date: Tue, 12 Apr 2016 13:30:50 +1200 Subject: [PATCH] Don't serve index from static files This switch prevents the static files from serving `index.html` as an index. Fixes #99. --- dist/server/index.js | 2 +- src/server/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/server/index.js b/dist/server/index.js index 150a5922d2cc..4635a452f52f 100755 --- a/dist/server/index.js +++ b/dist/server/index.js @@ -73,7 +73,7 @@ if (_commander2.default.staticDir) { var staticPath = _path2.default.resolve(_commander2.default.staticDir); if (_fs2.default.existsSync(staticPath)) { logger.log('=> Loading static files from: ' + staticPath + ' .'); - app.use(_express2.default.static(staticPath)); + app.use(_express2.default.static(staticPath, { index: false })); } else { logger.error('Error: no such directory to load static files: ' + staticPath); process.exit(-1); diff --git a/src/server/index.js b/src/server/index.js index 7e887e608251..59862615138a 100755 --- a/src/server/index.js +++ b/src/server/index.js @@ -37,7 +37,7 @@ if (program.staticDir) { const staticPath = path.resolve(program.staticDir); if (fs.existsSync(staticPath)) { logger.log(`=> Loading static files from: ${staticPath} .`); - app.use(express.static(staticPath)); + app.use(express.static(staticPath, { index: false })); } else { logger.error(`Error: no such directory to load static files: ${staticPath}`); process.exit(-1);