class Stout::Server

Included Modules

Defined in:

stout/server.cr

Constant 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

Constructor Detail

def self.new(use_ssl : Bool = false, reveal_errors : Bool = false, use_static : Bool = true, use_missing : Bool = false) #

[View source]

Instance Method Detail

def call(context) #

[View source]
def default_route : String #

[View source]
def default_route=(path) #

[View source]
def delete(path : String, name : Symbol | Nil = nil, &block : Stout::Context -> Nil) #

[View source]
def get(path : String, name : Symbol | Nil = nil, &block : Stout::Context -> Nil) #

[View source]
def listen #

[View source]
def listen_message!(protocol : String) #

[View source]
def missing : Stout::Context -> Nil #

[View source]
def patch(path : String, name : Symbol | Nil = nil, &block : Stout::Context -> Nil) #

[View source]
def post(path : String, name : Symbol | Nil = nil, &block : Stout::Context -> Nil) #

[View source]
def put(path : String, name : Symbol | Nil = nil, &block : Stout::Context -> Nil) #

[View source]
def reveal_errors : Bool #

[View source]
def rewrite(path, new_path) #

[View source]
def rewrites : Hash(String, String) #

[View source]
def route_names : Hash(Symbol, String) #

[View source]
def routes : Radix::Tree(Stout::Context -> Nil) #

[View source]
def routes=(routes : Radix::Tree(Stout::Context -> _)) #

[View source]
def set_missing(&block : Stout::Context -> Nil) #

[View source]
def ssl_context : OpenSSL::SSL::Context::Server #

[View source]
def static_location : String #

[View source]
def static_location=(static_location : String) #

[View source]
def use_missing : Bool #

[View source]
def use_ssl : Bool #

[View source]
def use_static : Bool #

[View source]