- 📍 Overview
- 👾 Features
- 🚀 Getting Started
- 🔧 Configuration
- ⌨️ Examples
- ❕ Disclaimer
- 🎗 License
- 🙌 Acknowledgments
A lightweight, unofficial static file server powered by the Filen.io SDK. Designed for public, read-only access to files such as images, PDFs, and videos.
- Serve files from either all public buckets — or via one specific master bucket1
- Supports server-wide CORS configuration, and JSON CORS configurations23 inside each bucket - mimics AWS S3 CORS configuration structure (example)
- Supports file downloads4 via search parameters in GET requests (e.g.
.../file.jpg?dl=1
) - Supports file ignores5 (e.g.
["secret.json", { endsWith: ".key" }]
)
Node.js version:
- Minimum: v22.6.0
- Preferred: v23.7.0
In your project, install using NPM:
npm install filen-public-express
- Create a bucket on Filen.io starting with
public_
(e.g.public_myimages
) - Initialize the server:
import { FilenPublicExpress } from "filen-public-express";
const server = new FilenPublicExpress({
user: {
sdkConfig: {
email: "[email protected]",
password: "yourfilenpassword"
}
}
});
await server.start();
- Start the server:
node server.js
You should now be able to access the files in your public buckets in your browser.
(e.g. http://localhost:1700/myimages/mydog.jpg
)
Note
Only files in public buckets (with public_
prefix) can be accessed. (e.g. public_myimages
) The prefix is omitted in the URL pathname.
Option | Type | Default | Description |
---|---|---|---|
methods |
"GET" |
"GET" |
Only GET method is supported |
origin |
string | string[] |
"*" |
Allowed Origins/Referers |
3Place this file inside your bucket to configure CORS settings:
[
{
"AllowedMethods": ["GET"],
"AllowedOrigins": ["https://example.com"]
}
]
Important
Must be an array, only "GET"
method supported, origin "*"
is used to allow all.
Mimics AWS S3 CORS configuration structure.
Examples can be found in the examples folder.
This project is not affiliated with or endorsed by Filen.io. It is provided as is, without any warranties or guarantees. The author assumes no responsibility for any issues, including but not limited to data privacy, security risks, or legal compliance arising from the use of this software. Use at your own risk.
Distributed under the AGPL-3.0 License. See LICENSE for more information.
This project:
- Uses filen-sdk-ts - The official Filen.io TypeScript SDK
- Incorporates code from filen-s3