diff --git a/src/kemal.cr b/src/kemal.cr index 65954ca..7029a80 100644 --- a/src/kemal.cr +++ b/src/kemal.cr @@ -5,11 +5,14 @@ require "./kemal/middleware/*" module Kemal # The command to run a `Kemal` application. - def self.run + # The port can be given to `#run` but is optionnal. + # If not given Kemal will use the default config port (`Kemal::Config#port`) + def self.run(port = nil) Kemal::CLI.new config = Kemal.config config.setup config.add_handler Kemal::RouteHandler::INSTANCE + config.port = port if port config.server = HTTP::Server.new(config.host_binding, config.port, config.handlers) {% if ! flag?(:without_openssl) %}