Ignoring Files
Local Bridge supports two methods for hiding files from the public listing. Hidden files cannot be accessed even with a direct URL - they are not served from the public share.
Method 1: .lbignore File
Create a file named .lbignore in the root of your served folder. The syntax is identical to .gitignore:
# Hide environment files .env .env.local # Hide log files *.log # Hide entire directories node_modules/ .git/ secrets/ __pycache__/ # Hide specific file types *.key *.pem
When the CLI starts, it reads this file and prints how many patterns were loaded:
Loaded 4 ignore patterns
Method 2: --ignore Flag
Pass comma-separated patterns directly as a CLI flag:
localbridge --ignore "*.log,.env,node_modules" ./project
Or via environment variable:
LOCALBRIDGE_IGNORE="*.log,.env,node_modules" localbridge ./project
Pattern Syntax
| Pattern | Matches |
|---|---|
| *.log | All files ending in .log |
| .env | Exact file named .env |
| secrets/ | Entire directory named secrets |
| temp* | All files starting with temp |
| build/** | All files in build directory (recursive) |
| !important.env | Negation — re-include this file |
| *.key | All files ending in .key (SSL certs, etc.) |
Security Implications
Even if someone guesses the exact file path (for example /secret.env), they will receive a 404 Not Found response. The ignore system operates at the HTTP handler level, not just the directory listing.