Canvas
Static hosting with a same-origin API — no CORS, no ceremony.
Canvas serves your static files — HTML, CSS, JavaScript, images — and forwards any request
under /api/* to your Atomic functions. Your frontend and your backend live at the
same origin, so the browser just calls /api/… with no CORS headers,
no proxy config, and no separate API domain to manage.
/api/items as if it were a local file — same domain, same TLS, one deploy. The CORS
problem simply doesn't exist.
Deploy a site
# serve a folder at the root
drift canvas deploy ./my-site
# mount a folder under a sub-path
drift canvas deploy ./admin --route /admin
Canvas zips the folder, uploads it, and serves it over HTTPS at your slice's URL — live immediately.
How routing works
| Request | Served by |
|---|---|
GET / | Canvas → index.html |
GET /styles.css | Canvas → the static file |
GET /api/items | Atomic → the http=get:items function |
POST /api/items | Atomic → the http=post:items function |
Anything under /api/ goes to your functions; everything else is served as a static file.
Single-page apps
Deploy your framework's build output (the contents of dist/ or build/) like any
other folder. Canvas serves HTML with the right content types and injects a <base href>
tag when one is missing, so your assets resolve correctly no matter which path the app is mounted at.
Multiple sites
A slice can host several sites, each at its own route. Deploy them with different --route
values:
drift canvas deploy ./marketing # at /
drift canvas deploy ./blog --route /blog # at /blog
drift canvas deploy ./admin --route /admin # at /admin
In a Driftfile
Declare your sites alongside everything else and ship them with one command:
canvas:
sites:
- ./site # mounted at /
- dir: ./blog
route: /blog # mounted at /blog
A full-stack app — a frontend, an API, and its data — is just three sections of one file:
name: my-app
atomic:
functions:
- get-items
- create-item
backbone:
nosql:
- items
canvas:
sites:
- ./frontend/build
drift project deploy
Your build is served at /, your functions answer at /api/*, and your data
lives in Backbone — all on the same origin. See the
Driftfile reference for every option.
Custom domains
Every slice answers at <username>-<slice>.ondrift.eu with TLS handled for you,
and you can point your own hostname at it: drift slice domain add yoursite.com, add the DNS
records it prints, then drift slice domain verify yoursite.com — Drift issues and
renews the certificate. The Quick Start walks
the full flow.