Backend services
Ephemeral and always-on backend services.
Beyond the frontend, Code runs backend services: APIs, workers, and scripts that live alongside your app.
Two kinds of service
- Ephemeral services run inside your workspace container: quick APIs and workers that live while you're building.
- Always-on services get their own dedicated machine with persistent storage and a public URL — always reachable, even when your workspace is asleep.
You pick the type when you create the service, and creation can start from a template instead of a blank slate.
| Runtime | For |
|---|---|
| Bun | The default: a fast all-in-one JavaScript runtime |
| Node.js | JavaScript / TypeScript backends |
| Python | Python APIs, workers, and scripts |
The flow is: create a service (pick a runtime, set env vars) → start it → Modus brings it up and checks its health endpoint → status goes to running. You can stop, restart, tail logs, and watch status. A crashed process or failed health check flips it to error with the last error shown.
Reaching a service
Every running service gets a stable URL your frontend can call, injected into the workspace env automatically (VITE_SERVICE_{NAME}_URL / NEXT_PUBLIC_SERVICE_{NAME}_URL), so wiring the frontend to a service is reading an env var, not hardcoding a host.