module Runcobo

Defined in:

runcobo.cr
runcobo/action.cr
runcobo/actions/filters.cr
runcobo/actions/healthcheck.cr
runcobo/actions/redirector.cr
runcobo/actions/render.cr
runcobo/actions/router.cr
runcobo/handlers/error_handler.cr
runcobo/handlers/log_handler.cr
runcobo/handlers/request_info_handler.cr
runcobo/handlers/route_handler.cr
runcobo/handlers/route_not_found_handler.cr
runcobo/handlers/static_files.cr
runcobo/log.cr
runcobo/pagination.cr
runcobo/proxy_config.cr
runcobo/request_body_limit.cr
runcobo/request_info.cr
runcobo/request_input.cr
runcobo/request_tracker.cr
runcobo/server.cr
runcobo/structs/route.cr
runcobo/upload_file.cr
runcobo/validation.cr
runcobo/version.cr
runcobo/views.cr

Constant Summary

Log = ::Log.for("runcobo")
VERSION = "3.1.4"

Class Method Summary

Macro Summary

Class Method Detail

def self.logger(output : IO, *, level : ::Log::Severity = :info) : ::Log #

Configure the shared logging pipeline. Global Log.setup and Log.capture also control framework logs, including exception chains and request context.


[View source]
def self.pretty_print_envs #

Pretty prints envs which can be used in Runcobo.


[View source]
def self.reuse_port_from_env(value : String | Nil) : Bool #

[View source]
def self.start(*, host : String = ENV["HOST"]? || "0.0.0.0", port : Int32 = (ENV["PORT"]? || 3000).to_i, reuse_port : Bool = reuse_port_from_env(ENV["REUSE_PORT"]?), handlers : Array(HTTP::Handler) = Runcobo::Server.default_handlers, cert : String | Nil = ENV["CERT"]?, key : String | Nil = ENV["KEY"]?, proxy_config : ProxyConfig = ProxyConfig.new, shutdown_timeout : Time::Span = 30.seconds) #

Starts Runcobo App with host ("0.0.0.0"), port (3000), reuse_port (false) and handlers (Runcobo::Server.default_handlers).

Or read ENV["HOST"] as host, read ENV["PORT"] as port.

Runcobo.start

Starts with custom host, port, reuse_port, handlers, cert and key.

Runcobo.start(
  host: "0.0.0.0",
  port: "5000",
  reuse_port: true,
  handlers: [
    Runcobo::RouteHandler.new,
    Runcobo::RouteNotFoundHandler.new,
  ],
  cert: "localhost.crt",
  key: "localhost.key"
)

[View source]

Macro Detail

macro render_to_string(template, *, layout = nil, dir = nil, layout_dir = nil, engine = nil) #

Render outside an action, with a path relative to the configured root.


[View source]
macro views(root, *, engine = :jbuilder, layout_dir = nil) #

Templates live beside their actions in src/actions, rendered with Jbuilder and with layouts in src/actions/layouts. Call Runcobo.views only to change that; paths are relative to the project root.


[View source]