Skip to content

Commit

Permalink
check all mounted directories for files
Browse files Browse the repository at this point in the history
  • Loading branch information
FredKSchott committed May 27, 2020
1 parent d7bb1aa commit 86e1113
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/commands/dev.ts
Expand Up @@ -414,22 +414,24 @@ export async function command(commandOptions: CommandOptions) {
continue;
}
if (requestedFile.startsWith(commandOptions.config.installOptions.dest)) {
return [await attemptLoadFile(requestedFile), null];
const fileLoc = await attemptLoadFile(requestedFile);
if (fileLoc) {
return [await attemptLoadFile(requestedFile), null];
}
}
if (isRoute) {
let fileLoc =
(await attemptLoadFile(requestedFile + '.html')) ||
(await attemptLoadFile(requestedFile + 'index.html')) ||
(await attemptLoadFile(requestedFile + '/index.html'));

if (!fileLoc && dirUrl === '/' && config.devOptions.fallback) {
const fallbackFile = path.join(dirDisk, config.devOptions.fallback);
fileLoc = await attemptLoadFile(fallbackFile);
}
if (fileLoc) {
responseFileExt = '.html';
return [fileLoc, null];
}
return [fileLoc, null];
} else {
for (const workerConfig of config.scripts) {
const {type, match} = workerConfig;
Expand Down

0 comments on commit 86e1113

Please sign in to comment.