Statico
Static websites hosting (Astro Starlight, Next.js, Docusaurus, Vitepress, plain HTML)
Introduction
Statico hosts static websites: a folder of HTML, CSS, JavaScript, and images. Your build tool makes the folder, one command deploys it, and it’s online with TLS and a free address.
- Astro Starlight
- Next.js export
- Docusaurus
- VitePress
- Vite (React, Vue, Svelte)
- Plain HTML
Features
- No downtime. The old version answers until the new one is complete. A deploy that fails changes nothing.
- Fast uploads. Only changed files are sent, small ones together in archives.
- Pretty addresses and redirects.
about.htmlis also/about/, and a_redirectsfile sets redirects. - Public or private. Public by default. A private website needs an API token.
Deploying an MPA
An MPA (multi-page app) is the default: a site with a page per route, such as Astro Starlight, Docusaurus, VitePress, or a Next.js export. It needs no extra options. Deploying happens from the CLI, so it fits into any CI pipeline, with a command or a config file.
With a command
Build your site, then deploy the folder:
npm run build
futrou statico deploy --include ./distThe first run creates the website and names it after the current folder (or pass a name). Later runs send only what changed, and do nothing when nothing did. The command prints where the site is live.
./dist puts the files of the folder at the root of the website. Add --dry-run to see what would change first.
With futrou.yml
Keep the website next to your code. futrou deploy runs the install command once, the build command every time, and uploads the result:
# futrou.yml
workspace: acme
project: website
installCommand: npm ci # once per device
buildCommand: npx astro build # before every deploy
statico:
docs:
include:
./dist: true
./dist/**/*.map: falsefutrou deployIn CI, use futrou deploy -y with a FUTROU_API_TOKEN secret.
Deploying an SPA
An SPA (single page app) answers every route with index.html and lets the browser router take over, as React, Vue, or Svelte apps built by Vite do. It needs two extra options: the fallback file and its status.
futrou statico deploy --include ./dist --fallback-file /index.html --fallback-status 200Or in futrou.yml:
statico:
app:
include:
./dist: true
fallbackFile: /index.html
fallbackStatus: 200The fallback is looked up per folder, so an app with a folder per language gets its own index.html for each.
Choosing the files
An include is a file, a folder, or a glob (*, **, {a,b}), relative to where you run the command or absolute. Includes run in order, so you can include a folder and then leave parts out:
| Option | Means |
|---|---|
--include ./dist | The files of ./dist, at the root. |
--include ./dist:docs | The same files, under docs/. |
--include ./robots.txt:seo/robots.txt | One file, moved. |
--exclude './dist/**/*.map' | Leave out source maps. |
Hidden files and folders (such as .env and .git) and .map files are never uploaded when found in a folder or by a glob, so a secret can’t go up by accident. Name one on purpose to include it, like --include ./dist/.well-known. Your config file is never uploaded either.
Redirects
Put a _redirects file at the root of your site, with one rule per line:
/old-page /new-page 301
/blog/* /news/:splatThe status defaults to 302, :name matches one path segment, and * matches the rest (used as :splat). The first matching rule wins.
How files are served
For each request Statico looks for the exact file, then the folder’s index.html, then the nearest 404.html (looked up from the requested folder upward, so multi-language sites work). Only GET and HEAD are accepted.
| Files | Cache-Control |
|---|---|
Pages (.html and paths without an extension) | no-cache |
| Assets (code, images, fonts, audio, video, documents) | public, max-age=31536000, immutable |
| Everything else | public, max-age=0, must-revalidate |
Give assets hashed file names (most build tools do) so a new deploy gets new URLs.
Custom domains
Every website works on its statico-xxx.futrou.cloud address. For your own domain, create an HTTP proxy in the same project with the website as its target. See Proxy.
Limits
The size of a website, the number of files, and the other limits are on the Limits page.
Templates
Ready-to-use projects with a futrou.yml are in the templates repository:
Last updated
