Spectivis Cloud
React
React on Spectivis Cloud
A Vite and React app deploys as a static site with client-side routing.
A Vite and React app is deployed as a static site. Cloud builds it and serves the output. There is no instance, no sleep and no credit used.
How Cloud detects it
Section titled “How Cloud detects it”Cloud treats the app as a Vite site when there is a vite.config.* file, or the build script runs vite build. The output folder is dist.
Client-side routing
Section titled “Client-side routing”Single-page apps with a router need every path to return index.html. Cloud does this by default: when no file matches the path, it sends index.html, and your router decides what to show. You can switch the fallback off in settings.
Variables
Section titled “Variables”Vite reads variables that start with VITE_ while it builds. They are baked into the files. If you change one, deploy again.
Do not put secrets in a static site. Everything in the output is public.
Limits
Section titled “Limits”- A static site can be up to 500 MB.
- Static sites do not count toward the limit of 10 apps.
- Static sites are free within fair use. See Static sites.
- Cloudflare caches static files by extension. HTML is not cached. See Cloudflare limits.
If your React app needs a server, use a framework with server rendering, such as Next.js.