CoreServer Deep Dive
The abstract base class for all Archibald servers. It wraps the Hapi.js instance and provides the registration hooks for the Archibald lifecycle.
Key Methods
createServer(options)
Initializes the underlying Hapi.js Server with standardized options. It configures the host, port, and global state management required for the Archibald request context.
registerRoutes(routes)
Maps Archibald's declarative route definitions (ServerRouteConfig[]) to the appropriate controller methods. It handles the lookup of instantiated controllers by name.
registerControllers(controllers)
Initializes and stores controllers in the DI container. This ensures that every controller is available for route handling and can have its dependencies injected.
registerDecorators(decorators)
Adds request-lifecycle hooks to enrich the ServerContext. Decorators are executed sequentially for every incoming request to populate things like configuration, headers, and app state.