A lightweight Node.js file explorer that powers private CDN browsing. It serves directory listings using a static HTML template and supports direct file downloads via signed routes.
- Clean, responsive directory listings styled through
template.html - Breadcrumb navigation with automatic parent links
- One-click downloads for files while keeping directories navigable
- Legacy query support for
?path=and/download?path=routes - Works entirely with Node.js core modules (no dependencies)
- Node.js v16 or newer (uses
fs.promisesand modern Intl formatting) - Files to expose under the explorer root
Clone the repository and install dependencies (none required):
node --version
npm install # optional; no packages requiredEnvironment variables control runtime behavior:
PORT(default10080): TCP port the service listens onHOST(default0.0.0.0): Bind addressEXPLORER_ROOT(default./explorerunder repo): Root directory to serve
# serve the current directory
EXPLORER_ROOT=/path/to/cdn node server.js
# or wrap with pm2/systemd/tmux for background operationPoint your reverse proxy (e.g., Nginx) at the chosen host and port. Ensure /explorer/ paths are proxied so relative links remain intact.
The HTML layout lives in template.html. The server replaces these placeholders at runtime:
{{breadcrumbs}}{{files}}{{year}}
Adapt the template to match your brand while keeping the placeholders intact.
- Directory traversal is prevented by normalizing and validating request paths
- MIME types are derived from file extensions with sane fallbacks
- Directory listings include file counts and human-readable sizes
MIT