router.get ('/api/healthcheck', function (req, res) { res.status(200).send(); });
// welcome screen in case / does not serve up any file yet
-router.get('/', function (req, res) { res.status(200).sendFile(path.join(__dirname, '/frontend/welcome.html')); });
+function welcomePage(req, res, next) {
+ if (req.path !== '/') return next();
+ res.status(200).sendFile(path.join(__dirname, '/frontend/welcome.html'));
+}
var rootFolder = path.resolve(__dirname, process.argv[2] || 'files');
app.use(router);
app.use('/_admin', express.static(__dirname + '/frontend'));
app.use('/', express.static(rootFolder));
+app.use('/', welcomePage);
app.use('/', serveIndex(rootFolder, { icons: true }));
app.use(lastMile());