Core Module

The Azu module is the main entry point for creating Azu applications.

Including Azu

module MyApp
  include Azu
end

Configuration

configure

Configure application settings.

Azu.configure do |config|
  config.port = 8080
  config.host = "0.0.0.0"
  config.env = Environment::Production
  config.template_hot_reload = false
end

Configuration Options

Option
Type
Default
Description

port

Int32

4000

HTTP server port

host

String

"0.0.0.0"

Bind address

env

Environment

Development

Environment mode

template_hot_reload

Bool

true

Reload templates on change

log

Log::Severity

Debug

Log level

cache

Cache::Store

MemoryStore

Cache backend

Environment

Checking Environment

Starting the Application

start

Start the HTTP server with handlers.

Parameters:

  • handlers : Array(HTTP::Handler) - Handler chain

start (block)

Start with a block for additional setup.

Cache Access

cache

Access the configured cache store.

Router Access

router

Access the application router.

Logging

log

Access the application logger.

Type Aliases

Constants

See Also

Last updated

Was this helpful?