How to use the filer.Path.join function in filer

To help you get started, we’ve selected a few filer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github humphd / nohost / src / webserver.js View on Github external
function maybeServeIndexFile() {
        const indexPath = Path.join(path, directoryIndex);

        fs.stat(indexPath, function(err, stats) {
          if(err) {
            if(err.code === 'ENOENT' && !disableIndexes) {
              // Fallback to a directory listing instead
              serveDirListing();
            } else {
              // Let the error (likely 404) pass through instead
              serveError(path, err);
            }
          } else {
            // Index file found, serve that instead
            serveFile(indexPath, stats);
          }
        });
      }