Teral
Frameworks

Static sites

Deploy Vite, Astro, Create React App, Angular and other static builds.

A site that builds to static files, such as a Vite or Astro project, needs no server code. Teral runs your build script and serves the output with a small web server.

When Teral serves your files

This happens automatically when the project uses Vite, Astro, Create React App, Angular or React Router in static mode, and package.json has no start script. With a start script, Teral runs that instead.

Teral finds the output folder from the framework, such as dist for Vite. If yours is elsewhere, set the variable RAILPACK_SPA_OUTPUT_DIR to it, for example build.

What the server does

  • Paths without a file fall back to index.html, so client-side routing works.
  • /health always answers 200, which makes it a good health check path.
  • Responses are compressed with gzip or zstd.

Variables

Build tools write variables into the files at build time, such as VITE_ variables in Vite or PUBLIC_ variables in Astro. Anyone can read them in the browser, so never put secrets there. After changing one, deploy again.

Edit on GitHub

On this page