Created
January 25, 2018 19:28
-
-
Save Willamin/8854c9e0998641260952e9bdf00de5d9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "http/server" | |
class MyRoutingHandler | |
include HTTP::Handler | |
def call(context) | |
case context.request.path | |
when "/", "/home" | |
context.response << "hello" | |
end | |
end | |
end | |
puts "listening" | |
HTTP::Server.new("127.0.0.1", 1234, [ | |
MyRoutingHandler.new, | |
]).listen |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment