Overview
The folder service consists of:- Node.js server (
server/lan-media-server.mjs) that scans directories and serves videos - Admin panel for configuring video stream services
- REST API for browsing libraries and streaming videos
- Multi-service support - configure multiple video folders as separate services
Environment Variables
Server listening address. Use
0.0.0.0 to accept LAN connections.Server port number.
Optional: Initial media directory path. If set, creates a default service on first startup.Example:
/Volumes/Media/Movies or C:\\VideosPath to web application static files.
Whether to serve the web application. Set to
false to disable static file hosting.Path to the configuration file that persists service definitions.
Comma-separated list of root directories that can be browsed in the admin panel.
- Windows: Auto-detects all drive letters (C:\, D:\, etc.)
- macOS/Linux: Defaults to
/or usesMEDIA_ROOTas base - Custom: Set explicitly like
BROWSE_ROOTS=/mnt/videos,/mnt/movies
Milliseconds between automatic directory rescans (15 seconds by default).
Starting the Server
Development Mode
Run both frontend and backend simultaneously:Configuration File
Services are persisted inlan-media-config.json:
ID of the currently active service. Clients default to this service when connecting.
Array of service configurations.Each service has:
id- Unique identifier (auto-generated SHA1 hash)name- Display name shown to usersmediaRoot- Absolute path to video directory
Supported Video Formats
The server automatically scans for these video extensions:Special Handling
.tsfiles: Must be at least 5MB to be recognized as video (filters out TypeScript files)- Subdirectories: Automatically grouped into virtual “libraries”
- File organization: Top-level folders become library names
Directory Structure Example
- “Action” (2 videos)
- “Comedy” (1 video)
- “Documentary” (1 video)
API Endpoints
Public Endpoints
Health check endpoint.Response:
List all configured services.Response:
Get libraries for the current service.Query params:
serviceId(optional): Override which service to query
Fetch videos from a library.Query params:
libraryId: Filter by libraryfeedType:latestorrandomskip: Pagination offsetlimit: Number of items (default: 20)serviceId: Service to query
Stream a video file with Range request support.Supports:
- Full file download
- Partial content (HTTP 206)
- HEAD requests
Admin Endpoints
See Admin Panel for details on:/api/admin/config/api/admin/browse/api/admin/services(POST, DELETE)/api/admin/select
Docker Deployment
Run the folder service in a container:Docker Environment Variables
The Dockerfile sets these defaults:Volume Mounts
/app/data- Persist configuration file/media- Mount your video directory (read-only recommended)
Client Connection
Default Service Loading
In development mode (localhost:5173), the server URL defaults to http://127.0.0.1:5176:
Troubleshooting
”Service not found” error
Ensure at least one service is configured via the admin panel.Videos not appearing
- Check
BROWSE_ROOTSincludes your media directory - Verify file extensions are supported
- Wait for initial scan to complete (logs show video count)