added basic http server
This commit is contained in:
1 parent
1c9e57de26
commit
9974cadb4e
1 file changed
+11
@@ -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
|
||||
Reference in new issue
Block a user