require "http/server"
server = HTTP::Server.new(8080) do |context|
context.response.content_type = "text/plain"
context.response.print "Hello BrisRuby!"
end
puts "Listening on http://127.0.0.1:8080"
server.listen
require "kemal"
get "/" do
"Hello BrisRuby!"
end
Kemal.run
require "sinatra"
get "/" do
"Hello BrisRuby!"
end
395μs
if rand(2) > 0
my_string = "hello world"
end
puts my_string.upcase
$ crystal hello_world.cr
Error in hello_world.cr:5: undefined method 'upcase'
for Nil (compile-time type is (String | Nil))
puts my_string.upcase
^~~~~~