added basic http server
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
# TODO: Write documentation for `Kotatsu`
|
# TODO: Write documentation for `Kotatsu`
|
||||||
|
|
||||||
require "option_parser"
|
require "option_parser"
|
||||||
|
require "http/server"
|
||||||
|
|
||||||
module Kotatsu
|
module Kotatsu
|
||||||
VERSION = "0.1.0"
|
VERSION = "0.1.0"
|
||||||
@@ -18,4 +19,14 @@ module Kotatsu
|
|||||||
exit
|
exit
|
||||||
end
|
end
|
||||||
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
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user