mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
parent
d41ad90826
commit
39cfe14811
1 changed files with 4 additions and 1 deletions
|
@ -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) %}
|
||||
|
|
Loading…
Reference in a new issue