Skip to content

Example: API with frontend ​

Updated: 23 October 2026

A common setup: a single-page frontend (React, Vue, Svelte) and an API (Node, Python, Go). Two ways work today.

Variant A: one service ​

The API also serves the built frontend files. This is the simplest and cheapest way: one URL, no CORS, one deployment.

json
{
  "api_version": "v1alpha1",
  "services": [{
    "name": "app",
    "source": { "type": "upload", "artifact_id": "art_…" },
    "port": 8080,
    "resources": { "memory_mb": 256 },
    "health": { "path": "/api/health" }
  }]
}

In the Dockerfile you first build the frontend (multi-stage) and copy it into the API image. Cost: €2.19/month at 24/7.

Variant B: two services ​

web (static web server with the frontend) and api. The frontend calls the API over its public URL, so the API must allow CORS for https://web-<project>.apps.helfinity.cloud.

json
{
  "api_version": "v1alpha1",
  "services": [
    { "name": "web", "source": { "type": "upload", "artifact_id": "art_…", "context_dir": "frontend" },
      "port": 8080, "resources": { "memory_mb": 128 } },
    { "name": "api", "source": { "type": "upload", "artifact_id": "art_…", "context_dir": "backend" },
      "port": 8080, "resources": { "memory_mb": 256 }, "health": { "path": "/health" } }
  ]
}

Both services can be built from the same archive, with a different context_dir.

Data ​

The API stores its data in an external database (data and storage). SQLite in the container works with a volume holding the file; without a volume it is gone on every restart and deployment.