Second-To-Last-Fixadoo

This commit is contained in:
Hannah-Dagemark 2024-05-23 14:47:42 +02:00
commit 2ce8a9c28b
6 changed files with 62 additions and 29 deletions

24
main.rb
View file

@ -1,4 +1,26 @@
require_relative 'lib/tcp_server'
server = HTTPServer.new(4567)
r = Router.new
r.add_route("GET",/\/grillkorv\/\d/) do |id, senap|
if File.open("./public/grillkorv.html") != nil
File.open("./public/grillkorv.html")
else
"Html not found"
end
end
# Headache: r.add_route("GET","/grillkorv/:id") do |id, senap|
r.add_route("GET",/\/grillkorv\/\d/) do |id, senap|
if File.open("./public/grillkorv.html") != nil
File.open("./public/grillkorv.html")
else
"Html not found"
end
end
#r.add_route("GET","/favicon.ico")
server = HTTPServer.new(4567, r)
server.start