parent
d41ad90826
commit
39cfe14811
1 changed files with 4 additions and 1 deletions
|
@ -5,11 +5,14 @@ require "./kemal/middleware/*"
|
||||||
|
|
||||||
module Kemal
|
module Kemal
|
||||||
# The command to run a `Kemal` application.
|
# 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
|
Kemal::CLI.new
|
||||||
config = Kemal.config
|
config = Kemal.config
|
||||||
config.setup
|
config.setup
|
||||||
config.add_handler Kemal::RouteHandler::INSTANCE
|
config.add_handler Kemal::RouteHandler::INSTANCE
|
||||||
|
config.port = port if port
|
||||||
|
|
||||||
config.server = HTTP::Server.new(config.host_binding, config.port, config.handlers)
|
config.server = HTTP::Server.new(config.host_binding, config.port, config.handlers)
|
||||||
{% if ! flag?(:without_openssl) %}
|
{% if ! flag?(:without_openssl) %}
|
||||||
|
|
Loading…
Reference in a new issue