Initial commit - Rebase of local and remote branches

This commit is contained in:
maddiebaka
2023-07-29 16:04:45 -04:00
parent 961f0149eb
commit 7e0640dc1c
16 changed files with 237 additions and 2 deletions

25
config.ru Normal file
View File

@@ -0,0 +1,25 @@
SERVE_DIR="/Volumes/Exodrive/Code/gemini-bridge-rack/skeksis/pub_gemini"
class SkeksisApp
def call(env)
status = 200
#headers = { "Content-Type" => "text/html" }
headers = {}
body = resolve_path(SERVE_DIR + env['PATH_INFO'])
[status, headers, body]
end
def resolve_path(path)
if Dir.exist?(path)
return Dir.each_child(path).map {|i| "#{i}\n"}
elsif File.exist?(path)
file = File.open(path, 'r')
file.readlines
else # path is invalid
return nil
end
end
end
run SkeksisApp.new