module Athena::Framework
#
Constants#
ENV_NAME = "ATHENA_ENV"#
The name of the environment variable used to determine Athena's current environment.
Log = ::Log.for("athena.framework")#
VERSION = "0.23.0"#
Class methods#
.environment : String#
Returns the current environment Athena is in based on ENV_NAME. Defaults to development if not defined.
.run(port : Int32 = 3000, host : String = "0.0.0.0", reuse_port : Bool = false, ssl_context : ATH::SSLContext | 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
ssl_context can be used to serve HTTPS requests, unless the application is built with -Dwithout_openssl.
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.
.run_console : Nil#
Runs an ACON::Application with the commands registered as services as the entrypoint of Athena::Console.
Requires the Console bundle to be registered.
Checkout the Getting Started docs for more information.
Macros#
configure(config)#
Primary entrypoint for configuring Athena Framework applications.
See the Getting Started docs for more information.
Note
This is an alias of ADI.configure.
register_bundle(bundle)#
Registers the provided bundle.
See the Getting Started docs for more information.
Note
This is an alias of ADI.register_bundle.