Skip to content

Instantly share code, notes, and snippets.

@watzon
Last active October 20, 2016 22:56
Show Gist options
  • Save watzon/9ae85f31052c502af3b548ee27996a95 to your computer and use it in GitHub Desktop.
Save watzon/9ae85f31052c502af3b548ee27996a95 to your computer and use it in GitHub Desktop.
# A very basic HTTP server
require "http/server"
server = HTTP::Server.new(8080) do |context|
context.response.content_type = "text/plain"
context.response.print "Hello world, got #{context.request.path}!"
end
puts "Listening on http://127.0.0.1:8080"
server.listen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment