Herofs server configable via env vars
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user