Starting crystal in production mode
Simply pass a port to Kemal.run
:
require "kemal"
get "/" do
"Hello World!"
end
port = ARGV[0]?.try &.to_i?
Kemal.run port
Build:
crystal build src/myapp.cr
Run:
./myapp # default port 3000
./myapp 80
./myapp 443