Creates a new Server instance
AdonisJS application instance
Encryption service for secure operations
Event emitter for server lifecycle events
Logger instance for server operations
Server configuration settings
Indicates whether the server has completed its boot process
Indicates whether async local storage is enabled for request context
Creates a testing middleware pipeline for unit/integration testing
Array of middleware classes to include in pipeline
TestingMiddlewarePipeline instance for test execution
Registers global middleware to run on all incoming HTTP requests
Array of lazy-imported middleware classes
The Server instance for method chaining
Registers a custom error handler for HTTP request processing
Lazy import of the error handler class
The Server instance for method chaining
Initializes the server by compiling middleware, committing routes, and resolving handlers
Performs the following operations:
Configures the underlying Node.js HTTP/HTTPS server with timeout settings
Node.js HTTP or HTTPS server instance
Gets the underlying Node.js HTTP/HTTPS server instance
The configured server instance or undefined if not set
Creates a Request instance from Node.js request/response objects
Node.js IncomingMessage
Node.js ServerResponse
New Request instance
Creates a Response instance from Node.js request/response objects
Node.js IncomingMessage
Node.js ServerResponse
New Response instance
Creates an HttpContext instance with request-specific logger
New HttpContext instance
Gets the list of registered global middleware
Array of parsed global middleware
Handles an incoming HTTP request by creating context and processing through pipeline
Node.js IncomingMessage
Node.js ServerResponse
Promise that resolves when request processing is complete
The Server class provides the core HTTP server implementation for AdonisJS.
It handles incoming HTTP requests by processing them through middleware pipelines, routing them to appropriate handlers, and managing response generation. The server supports custom error handling, middleware registration, and various Node.js HTTP server configurations.
Example