Configure an HTTP API server to expose your Ditto database via REST endpoints
HttpServer
resource creates an HTTP API endpoint for your Ditto database, allowing any HTTP client (including web browsers) to query and manipulate data using standard REST methods. This enables integration with systems that cannot use the Ditto SDK directly.
Field | Type | Description |
---|---|---|
resource_type | string | Must be "HttpServer" |
db_id | string | The database ID (UUIDv4 format) to expose via HTTP. Must match an existing DittoDatabase resource |
listen_addr | string | Address and port to listen on (format: "host:port" ). |
http_api | boolean/object | Enable HTTP API endpoints. Use true to enable all, false to disable, or an object for fine-grained control |
Field | Type | Default | Description |
---|---|---|---|
base_path | string/null | Uses db_id | URL path prefix for the API endpoints. Must be a valid URI path segment |
listen_addr
field specifies where the HTTP server listens for connections:
"127.0.0.1:PORT"
or "localhost:PORT"
"[::1]:PORT"
or "[::]:PORT"
http_api
field controls which endpoints are enabled:
Field | Type | Default | Description |
---|---|---|---|
enable_execute | boolean | true | Enable the /execute endpoint for DQL queries |
enable_healthcheck | boolean | false | Enable the health check endpoint |
POST /<base_path>/execute
Execute DQL queries against the database.
Request body:
GET /<base_path>
Simple health check that returns HTTP 200 if the server is running.
http://127.0.0.1:8080/12345678-1234-4123-1234-123456789012/execute
http://localhost:3000/my_server/execute
http://127.0.0.1:9090/health
db_id
must exactly match a DittoDatabase resource in your configuration"[::1]:8080"
)