Every service inDocumentation Index
Fetch the complete documentation index at: https://docs.compartment.dev/llms.txt
Use this file to discover all available pages before exploring further.
compartment.yml has a kind that tells Compartment what role it plays in your application. The kind controls whether the service gets a route URL, whether it handles HTTP traffic, and how the platform manages its lifecycle. You set the kind with the kind field in a service config object; if you omit it, Compartment defaults to web.
Available kinds
| Kind | HTTP access | Gets a route URL | Typical use |
|---|---|---|---|
web | Yes | Yes | Browser-facing web frontend |
api | Yes | Yes | HTTP API consumed by other services or clients |
worker | No | No | Long-running background processor |
job | No | No | Short-lived task that runs to completion |
cron | No | No | Scheduled task triggered on a timer |
web
web is the default kind. Use it for services that serve HTTP responses directly to browsers or external clients. Compartment gives a web service a route URL and exposes it through the platform’s public proxy.
accessMode: public, any user with the URL can reach the service without signing in to Compartment. The default accessMode is authenticated, which requires a valid Compartment session.
api
Use api for HTTP services that are not directly browser-facing but still need a route URL — for example, a REST or GraphQL API consumed by your web service or by external API clients.
web, an api service is routable and can appear as on or to in compartment.routes.yml. The distinction between web and api is semantic — it signals intent to other developers and to the platform, but both kinds receive HTTP traffic and a route URL.
worker
Use worker for long-running background processes that do not serve HTTP. Workers are deployed and kept alive like web services, but they do not receive a route URL and are not reachable over HTTP.
job
Use job for a service that runs once to completion and then exits. Compartment does not keep a job service running persistently. No route URL is assigned.
cron
Use cron for a service that runs on a schedule. Like job, a cron service has no route URL and no persistent HTTP access.
cron kind marks a service as schedule-driven. Scheduling details are managed outside compartment.yml.
accessMode
The accessMode field applies to web and api services. It controls whether Compartment’s proxy requires authentication before allowing a request through.
| Value | Description |
|---|---|
authenticated | Default. Only users with a valid Compartment session can access the service URL. |
public | Any request is forwarded to the service without authentication. |
accessMode has no effect on worker, job, or cron services because those kinds do not receive HTTP traffic.
Choosing the right kind
Is it browser-facing or an external HTTP endpoint?
Use
web for browser-facing services. Use api for HTTP services consumed by other services or API clients.Multi-service example
web is publicly accessible, api is authenticated by default, and worker runs in the background without a route URL.