Created
December 14, 2018 19:43
-
-
Save whalesalad/369b7a85edf6c2d125d4da64fec8b4eb to your computer and use it in GitHub Desktop.
This file contains hidden or 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 "json" | |
require "http/server" | |
server = HTTP::Server.new do |context| | |
environment = Hash.zip(ENV.keys, ENV.values) | |
context.response.content_type = "application/json" | |
context.response.print environment.to_json | |
end | |
address = server.bind_tcp(ENV["PORT"].to_i || 8080) | |
puts "Listening on http://#{address}" | |
server.listen |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment