diff --git a/solara/lib/core/dashboard/dashboard_server.rb b/solara/lib/core/dashboard/dashboard_server.rb index 9481423..2d5065c 100644 --- a/solara/lib/core/dashboard/dashboard_server.rb +++ b/solara/lib/core/dashboard/dashboard_server.rb @@ -47,23 +47,9 @@ def create_server @server = WEBrick::HTTPServer.new( Port: @port, DocumentRoot: @root, + DirectoryIndex: ['local.html'], Logger: logger ) - - @server.mount_proc '/' do |req, res| - path = req.path == '/' ? '/index.html' : req.path - file_path = File.join(@root, path) - - if File.exist?(file_path) && !File.directory?(file_path) - res.body = File.read(file_path) - res['Content-Type'] = WEBrick::HTTPUtils.mime_type(file_path, WEBrick::HTTPUtils::DefaultMimeTypes) - else - res.status = 404 - end - - # Add the source=local parameter to all responses - res['Location'] = "#{req.path}?source=local" if res.status == 302 - end rescue StandardError => e Solara.logger.failure("Error creating server: #{e.message}") exit(1) diff --git a/solara/lib/core/dashboard/index.html b/solara/lib/core/dashboard/index.html index c709d5b..80ba098 100644 --- a/solara/lib/core/dashboard/index.html +++ b/solara/lib/core/dashboard/index.html @@ -23,31 +23,9 @@ }