Jaguar constructor

Jaguar({
  1. String address = "0.0.0.0",
  2. int port = 8080,
  3. bool multiThread = false,
  4. SecurityContext? securityContext,
  5. bool autoCompress = false,
  6. ErrorWriter? errorWriter,
  7. SessionManager? sessionManager,
  8. FutureOr<void> onRouteServed(
    1. Context ctx
    )?,
})

Constructs an instance of Jaguar with given configuration.

address:port is the address and port at which the HTTP requests are listened. multiThread determines if the port can be serviced from multiple isolates. securityContext is used to configure HTTPS support. autoCompress determines if the response should be automatically compressed. errorWriter is used to write custom error page Response in cases of HTTP errors. sessionManager provides ability to use custom session managers.

Implementation

Jaguar({
  String address = "0.0.0.0",
  int port = 8080,
  bool multiThread = false,
  SecurityContext? securityContext,
  this.autoCompress = false,
  ErrorWriter? errorWriter,
  this.sessionManager,
  this.onRouteServed,
})  : errorWriter = errorWriter ?? DefaultErrorWriter(),
      _connectionInfos = [
        ConnectTo(
            address: address,
            port: port,
            securityContext: securityContext,
            multiThread: multiThread)
      ];