Skip to content

Instantly share code, notes, and snippets.

@watzon
Last active May 11, 2019 20:24
Show Gist options
  • Save watzon/bad8223c0b0f567c7b8236bb719f2413 to your computer and use it in GitHub Desktop.
Save watzon/bad8223c0b0f567c7b8236bb719f2413 to your computer and use it in GitHub Desktop.
Doing Crystal #1: A Ruby Comparison
# A very basic HTTP server
require "http/server"
server = HTTP::Server.new 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(8080)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment