Skip to content

module Athena::Framework #

See the external documentation for an introduction to Athena.

Also checkout the Architecture page for an overview of how the Athena Framework is designed.

Constants#

Log = ::Log.for("athena.framework")#

VERSION = "0.18.2"#

Class methods#

.run(port : Int32 = 3000, host : String = "0.0.0.0", reuse_port : Bool = false, ssl_context : OpenSSL::SSL::Context::Server | Nil = nil, *, prepend_handlers : Array(HTTP::Handler) = [] of HTTP::Handler) : Nil#

Runs an HTTP::Server listening on the given port and host.

require "athena"

class ExampleController < ATH::Controller
  @[ARTA::Get("/")]
  def root : String
    "At the index"
  end
end

ATH.run

prepend_handlers can be used to execute an array of HTTP::Handler before Athena takes over. This can be useful to provide backwards compatibility with existing handlers until they can ported to Athena concepts, or for supporting things Athena does not support, such as WebSockets.

See ATH::Controller for more information on defining controllers/route actions.

View source