class Syntropy::App
def initialize(machine, src_path, mount_path, opts = {})
def initialize(machine, src_path, mount_path, opts = {}) @machine = machine @src_path = File.expand_path(src_path) @mount_path = mount_path @opts = opts @module_loader = Syntropy::ModuleLoader.new(@src_path, @opts) @router = Syntropy::Router.new(@opts, @module_loader) @machine.spin do # we do startup stuff asynchronously, in order to first let TP2 do its # setup tasks @machine.sleep 0.15 @opts[:logger]&.call("Serving from #{File.expand_path(@src_path)}") @router.start_file_watcher if opts[:watch_files] end end