module Runcobo

Defined in:

cli.cr
commands/route_tables.cr
commands/routes.cr
runcobo.cr
runcobo/action.cr
runcobo/actions/healthcheck.cr
runcobo/actions/params/form.cr
runcobo/actions/params/json.cr
runcobo/actions/params/query.cr
runcobo/actions/params/url.cr
runcobo/actions/pipe.cr
runcobo/actions/redirector.cr
runcobo/actions/render.cr
runcobo/actions/router.cr
runcobo/handlers/log_handler.cr
runcobo/handlers/route_handler.cr
runcobo/handlers/route_not_found_handler.cr
runcobo/log.cr
runcobo/server.cr
runcobo/structs/route.cr
runcobo/version.cr

Constant Summary

Log = Runcobo.logger(STDOUT)
VERSION = "2.0.0"

Class Method Summary

Class Method Detail

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

Defines logger with output and level

Runcobo.logger(STDOUT, level: :info)

[View source]
def self.pretty_print_envs #

Pretty prints envs which can be used in Runcobo.


[View source]
def self.start(*, host : String = ENV["HOST"]? || "0.0.0.0", port : Int32 = (ENV["PORT"]? || 3000).to_i, reuse_port : Bool = !(!(ENV["REUSE_PORT"]? || false)), handlers : Array(HTTP::Handler) = Runcobo::Server.default_handlers, cert : String? = ENV["CERT"]?, key : String? = ENV["KEY"]?) #

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]