class Stout::Server
- Stout::Server
- Reference
- Object
Included Modules
- HTTP::Handler
Defined in:
stout/server.crConstant Summary
-
CERT_PATH =
ENV["SSL_CERTIFICATE"]? || "#{STOUT_CACHE_DIR}/server.crt"
-
CSR_PATH =
ENV["SSL_CERTIFICATE_SIGNER"]? || "#{STOUT_CACHE_DIR}/server.csr"
-
HOST =
ENV["HOST"]? || (case STOUT_ENV when Stout::Env::Production "0.0.0.0" else "localhost" end)
-
KEY_PATH =
ENV["SSL_CERTIFICATE_KEY"]? || "#{STOUT_CACHE_DIR}/server.key"
-
PORT =
((ENV["PORT"]?.try(&.to_i)) || 8888).as(Int32)
-
STOUT_CACHE_DIR =
ENV["STOUT_CACHE"]? || "#{File.dirname(PROGRAM_NAME)}/../.stout-cache"
-
STOUT_ENV =
ENV["STOUT_ENV"]?.try do |e| Stout::Env.parse?(e) end || Stout::Env::Development
Constructors
Instance Method Summary
- #call(context)
- #default_route : String
- #default_route=(path)
- #delete(path : String, name : Symbol | Nil = nil, &block : Stout::Context -> Nil)
- #get(path : String, name : Symbol | Nil = nil, &block : Stout::Context -> Nil)
- #listen
- #listen_message!(protocol : String)
- #missing : Stout::Context -> Nil
- #patch(path : String, name : Symbol | Nil = nil, &block : Stout::Context -> Nil)
- #post(path : String, name : Symbol | Nil = nil, &block : Stout::Context -> Nil)
- #put(path : String, name : Symbol | Nil = nil, &block : Stout::Context -> Nil)
- #reveal_errors : Bool
- #rewrite(path, new_path)
- #rewrites : Hash(String, String)
- #route_names : Hash(Symbol, String)
- #routes : Radix::Tree(Stout::Context -> Nil)
- #routes=(routes : Radix::Tree(Stout::Context -> _))
- #set_missing(&block : Stout::Context -> Nil)
- #ssl_context : OpenSSL::SSL::Context::Server
- #static_location : String
- #static_location=(static_location : String)
- #use_missing : Bool
- #use_ssl : Bool
- #use_static : Bool
Constructor Detail
def self.new(use_ssl : Bool = false, reveal_errors : Bool = false, use_static : Bool = true, use_missing : Bool = false)
#