Herofs server configable via env vars

This commit is contained in:
Scott Yeager
2025-10-03 13:37:34 -07:00
parent 0566d10a69
commit 2b2945e6f1
3 changed files with 41 additions and 23 deletions

View File

@@ -3,6 +3,7 @@ module herofs_server
import veb
import freeflowuniverse.herolib.hero.herofs
import freeflowuniverse.herolib.ui.console
import freeflowuniverse.herolib.core.redisclient
// FSServer is the main server struct
pub struct FSServer {
@@ -28,11 +29,12 @@ pub mut:
host string = 'localhost'
cors_enabled bool = true
allowed_origins []string = ['*']
redis ?&redisclient.Redis
}
// Create a new filesystem server
pub fn new(args NewFSServerArgs) !&FSServer {
fs_factory := herofs.new()!
fs_factory := herofs.new(redis: args.redis)!
mut server := FSServer{
port: args.port