This guide walks an Express 4/5 app from local code to a production URL with a database and per-user auth. Every step has runnable JavaScript code. By the end you have a working app atDocumentation Index
Fetch the complete documentation index at: https://getfloo.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
https://<app>.on.getfloo.com with a Postgres sibling service, signed-in users, and (optionally) your own domain.
If you’ve never deployed to floo before, read Golden Path first for the minimal three-command flow.
Before you start
You need:- An Express project (or
npm init -y && npm install express). - The project pushed to a GitHub repository.
- The floo CLI installed and authenticated (
curl -fsSL https://getfloo.com/install.sh | bashthenfloo auth login).
1. Add a Dockerfile
Dockerfile
2. Trust the proxy
floo’s edge sits in front of your Express app. Tell Express to trust it soreq.protocol, req.hostname, and req.ip reflect the original client request:
server.js
3. Initialize the floo config
floo.app.toml
4. Connect the repo and deploy
Your Express app is live at
https://my-express-app-dev.on.getfloo.com.5. Add a Postgres database
DATABASE_URL is injected. With pg:
db.js
npx prisma init); Prisma reads DATABASE_URL from the environment automatically.
6. Add per-user auth
floo manages user authentication for you. Setaccess_mode = "accounts" in floo.app.toml:
floo.app.toml
- Redirects unauthenticated requests to a hosted login page.
- Validates the session cookie on every request.
- Injects identity headers into every request that reaches your Express app.
server.js
7. Add a custom domain
app.set("trust proxy", true), Express reads req.hostname from X-Forwarded-Host automatically — no extra config needed.
8. Local development with prod data
dev_command locally with DATABASE_URL and other env vars sourced from your dev floo app — real Cloud SQL connection, no credentials in your shell history.
To also test signed-in flows for this accounts-mode app, add --fixture-user:
floo dev then starts a small proxy in front of each service that injects the same X-Floo-User-* headers floo’s gateway adds in production. The output table shows both the raw service URL and the auth-proxied URL — hit the auth-proxied one for any path that reads identity headers.
Common gotchas
/healthzis reserved. Cloud Run’s edge intercepts that exact path. Use/healthor/livez.- Bind to
0.0.0.0. Express defaults to0.0.0.0only when you pass it explicitly toapp.listen(port, "0.0.0.0", ...). Without it some setups bind tolocalhost. app.set("trust proxy", true)is required. Without it,req.protocolis alwayshttp, secure cookies don’t get set, andreq.ipis wrong.- ESM vs CommonJS. The examples use ESM (
import/export). For CJS, userequire()andmodule.exportsequivalently — the logic is identical.
What’s next
Add User Auth — full reference
Identity headers, access policies, and access modes in detail.
Managed Services
Postgres, Redis, Storage — what they cost and how isolation works.
Multi-Service Routing
Deploy Express alongside a Next.js or React frontend with shared origin.
Custom Domains
DNS, verification, multi-service routing.