added basic http server

This commit is contained in:
2021-12-29 01:48:15 +01:00
parent 1c9e57de26
commit 9974cadb4e

View File

@@ -1,6 +1,7 @@
# TODO: Write documentation for `Kotatsu`
require "option_parser"
require "http/server"
module Kotatsu
VERSION = "0.1.0"
@@ -18,4 +19,14 @@ module Kotatsu
exit
end
end
webserv = HTTP::Server.new do |context|
context.response.content_type = "text/plain"
context.response.print "Running kotatsu #{VERSION}"
end
webaddr = webserv.bind_tcp 8080
puts "Started kotatsu webserver on #{webaddr}"
webserv.listen
end