For AI agents: the complete documentation index is available at /hclapi/llms.txt, the full documentation bundle is available at /hclapi/llms-full.txt, and this page is available as Markdown at /hclapi/docs/manifest/server.md.

server

Declares transport-level settings: listener interface and port binding, connection timeouts, maximum request body size, RFC 9457 problem type resolution, and global OpenAPI metadata.

Declaration

server {
  host          = "0.0.0.0"
  port          = 8080
  read_timeout  = "15s"
  write_timeout = "30s"
  idle_timeout  = "60s"
  max_body_size = "25MB"

  problem {
    type_prefix = "https://docs.mycompany.com/errors/"
  }

  openapi {
    title   = "Acme Storefront API"
    version = "1.0.0"
  }
}

Transport attributes

All attributes are optional and inherit production-ready defaults.

AttributeTypeDefaultDescription
hoststring"127.0.0.1"Network interface to bind. Use "0.0.0.0" to listen on all interfaces.
portint8080TCP port.
read_timeoutDuration"15s"Maximum duration allowed to read the full request headers and body.
write_timeoutDuration"15s"Maximum duration allowed before timing out write operations on the response.
idle_timeoutDuration"60s"Maximum time an idle keep-alive connection remains open.
max_body_sizeByteSize"10MB"Requests with bodies exceeding this limit are immediately rejected with HTTP 413.

Child blocks

problem

Configures RFC 9457 Problem Details error type resolution for the application.

server {
  problem {
    type_prefix = "https://docs.mycompany.com/errors/"
  }
}
AttributeTypeDefaultDescription
type_prefixstring""Base type prefix for human-readable error documentation.

Problem type URI resolution

  • Without problem.type_prefix (default): Emits standard URNs (urn:hclapi:error:bad-request).
  • With a documentation URL: type_prefix = "https://docs.example.com/errors/" resolves to https://docs.example.com/errors/bad-request.
  • With a custom URN prefix: type_prefix = "urn:acme:error:" resolves to urn:acme:error:bad-request.

openapi

Declares top-level metadata for the automatically compiled OpenAPI 3.1 specification (title, description, deployment servers, category tags, contact, and license).

server {
  openapi {
    title       = "Acme Storefront API"
    version     = "1.2.0"
    description = "Customer accounts and order processing API."
  }
}
Full OpenAPI reference

All available options are documented in the OpenAPI configuration guide.

Example

server {
  host          = "0.0.0.0"
  port          = 8080
  read_timeout  = "30s"
  write_timeout = "60s"
  idle_timeout  = "120s"
  max_body_size = "50MB"

  problem {
    type_prefix = "https://developer.example.com/api/errors/"
  }

  openapi {
    title   = "Production API Gateway"
    version = "2.0.0"
  }
}