Skip to main content

Site config

Site settings live in .space/config/site.json and are read at deploy time. If the file is absent, all defaults apply.

{
"fallback": "404",
"exposeSpace": true
}

fallback​

What to do when a file is not found.

ValueBehavior
"404" (default)Return the 404 page
"index"Return the root index.html with status 200

"index" is meant for single-page applications (SPAs). It requires an index.html or index.htm in the site root; otherwise the deploy fails.

When enabled, every missing path returns index.html, including missing .js, .css and image files. If your app needs to tell a missing asset apart, handle that in the app.

After switching between the two modes, purge the CDN cache once. The edge may still serve the previous response.

exposeSpace​

Whether .space/ is publicly readable.

ValueBehavior
true (default)Files under .space/ are directly accessible; you can keep 404 page images and styles there
falseEverything under .space/ is private except the 404 template

With exposeSpace: true, the config file itself is public too. Do not put secrets under .space/.

Internal files​

.space/mode/ contains internal markers written by the platform. It is always private; do not edit it by hand.

Invalid config​

  • Invalid JSON: the deploy fails with site.json 不是合法的 JSON.
  • fallback is not "404" or "index", or exposeSpace is not a boolean: the deploy fails with an explanation.
  • Unknown keys are ignored.

Re-deploy after changing the config for it to take effect.


Next: Routing, Custom 404