Demonstrates pure static file serving — a whole site on Tissue with no cell code.
No JavaScript is needed. ribo deploy synthesises a minimal pass-through cell
automatically and uploads every file in ./public to a dedicated
object-storage bucket.
[cell]
name = "static-site"
static = "./public"That's the entire config. Deploy with:
ribo deployribo deploy detects static = "...", then:
- Derives a bucket name from the cell address (e.g.
abc123-files). - Creates the bucket in Garage via the G7 service (idempotent).
- Uploads every file under
./publicwith the correctContent-Type. - Synthesises this worker and deploys it as a normal JS cell:
export default { async fetch(req, env) { return env.FILES.fetch(req); } };
| Request | Served file |
|---|---|
/ |
public/index.html |
/about |
public/about/index.html |
/css/style.css |
public/css/style.css |
/missing |
public/404.html (HTTP 404) |
If you need both, use a normal JS cell with an explicit FILES binding:
[cell]
name = "hybrid-site"
js = "./worker.js"
[[bindings]]
type = "files"
binding = "FILES"
dir = "./public"export default {
async fetch(request, env) {
const url = new URL(request.url);
if (url.pathname.startsWith("/api/")) {
return handleApi(request, env);
}
return env.FILES.fetch(request);
}
};