Zum Inhalt springen
GigadriveDocs

Static sites

The assets-only fallback, covering when Gigadrive Network publishes your project root as edge assets and the configuration it writes to do it.

A project with no configuration file and no detected framework still deploys, as long as it looks like a static site. Gigadrive Network writes a minimal configuration for it and publishes the project root to the edge as static assets, which is what happens to a folder of HTML dropped into the console.

When the fallback applies

Two things have to be true. There is no configuration file at the project root under any accepted name, from gigadrive.ts to nebula.json as listed in Configuration, and no framework was detected.

The build then decides whether the project looks static, in this order:

  1. index.html at the project root. Static.
  2. Otherwise, a package.json at the project root. Not static, and the deployment fails with No config file found and no framework detected.
  3. Otherwise, the root listing is scanned for one entry that looks static, skipping dotfiles and configuration files. Any directory counts, and so does a file ending in .html, .htm, .css, .js, .mjs, .cjs, .json, .svg, .png, .jpg, .jpeg, .gif, .webp, .ico, .txt, .xml, .map, .woff, .woff2, .ttf or .eot. A LICENSE or a Makefile is skipped rather than counted against the project, so one match anywhere in the listing is enough.

The configuration it writes

The fallback writes a gigadrive.yaml at the project root with two keys in it, and nothing else:

version: 4
assets: '.'

The build log records No framework or config detected; deploying project root as static assets. Nothing else is inferred: no Function, no route table of your own, no environment variables.

What gets published

Every regular file under the project root, walked recursively to a depth of 100 directories. Files ending in .htaccess or .htpasswd are always dropped.

Each published file answers GET, HEAD and OPTIONS at its own path. An index.html also answers the directory that contains it, with or without a trailing slash: a published about/index.html answers /about and /about/, and one at the root answers /. A directory with no published index file returns 404 rather than falling back to a page from elsewhere in the site. Static assets covers this in full.

There is no single-page-app rewrite. A request for a path with no matching file returns 404, so a client-side router needs its own configuration file with a route pointing at your shell document.

Taking control

Write a gigadrive.yaml yourself once you have a build step, and point assets at its output directory instead of the project root:

version: 4
assets: dist

Static assets covers how they are served and cached after that.