A small, working example of a Deno + Vite + React app that deploys cleanly on DollarDeploy using its Deno buildpack.
A single Deno.serve process serves the Vite-built React frontend from dist/
and exposes a tiny JSON API. The page shows live info reported by the server and
a "Deployed with DollarDeploy" badge.
deno.json deno tasks (dev / build / start / test) + imports
deno.lock lockfile -> DollarDeploy runs `deno ci`
vite.config.ts builds the React app in src/ into dist/
index.html Vite entry
src/ React frontend (App.tsx, main.tsx, app.css, assets/logo.svg)
server.ts Deno.serve: static dist/ + /api/info + /health
server_test.ts deno test for the API handlers
| Route | Response |
|---|---|
GET / |
The React app (served from dist/) |
GET /api/info |
JSON: runtime, Deno version, env, port, server time |
GET /health |
{"ok":true} — used for health checks |
Requires Deno 2.x.
deno task dev # Vite dev server with HMR (frontend only)
deno task build # vite build -> dist/
deno task start # serve dist/ + API with Deno.serve (default port 3000)
deno task test # run the server testsTo run the production server locally exactly as DollarDeploy does:
deno task build
PORT=3000 HOSTNAME=127.0.0.1 NODE_ENV=production deno task start
# -> http://127.0.0.1:3000This app matches DollarDeploy's Deno buildpack with no extra configuration:
- Detected as a Deno app because
deno.jsonis present. - Install:
deno.lockis present, so the build runsdeno ci. - Build: runs
deno task build(vite build) to producedist/. - Start: systemd runs
deno task start, i.e.deno run --allow-net --allow-env --allow-read server.ts. - Port: defaults to
3000; DollarDeploy injectsPORT(andHOSTNAME,NODE_ENV,DENO_DIR) as environment variables. The server reads them fromDeno.env— it does not depend on a--env-file, which would not exist at runtime.
The start task only requests the permissions it needs: --allow-net to listen,
--allow-env to read PORT/HOSTNAME/NODE_ENV, and --allow-read to serve
files from dist/.