class

AptLarder::Admin::Server

Inherits Reference / Object

Routes requests between Api and Handler, enforcing independent auth policies: Bearer token for /api/*, HTTP Basic for everything else.

The two handlers are completely independent — Api has no knowledge of the UI, and Handler has no knowledge of the API.

Constructors

new(config : AdminConfig, cache : Cache, proxy : Proxy, evict_after_days : Int32 = 30)

evict_after_days is forwarded to Api as the default for POST /api/evict when no body is provided.

Source

Instance methods

handle(ctx : HTTP::Server::Context) : Nil

Handles a single request: authenticates then dispatches.

Source
start

Starts the admin HTTP server. Blocks until the server is closed.

Source