Created
March 24, 2017 09:23
-
-
Save grvm/e31ca0676aa60a86177955080a69ab5b to your computer and use it in GitHub Desktop.
HTTP Server in Crystal
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" | |
server = HTTP::Server.new(8080) do |context| | |
context.response.content_type = "text/plain" | |
context.response.print "Hello world at #{Time.now}" | |
end | |
puts "Listening on http://0.0.0.0:8080" | |
server.listen |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment