Skip to main content

Overview

Info Crypto is a Vite single-page application (SPA). The production build compiles all assets into a dist/ directory, which can be served by any static hosting provider. The live demo is deployed on Netlify: https://info-cripto.netlify.app/
Because Info Crypto uses React Router for client-side navigation, your hosting provider must be configured to redirect all requests to index.html. Without this redirect rule, navigating directly to a route such as /grafics or refreshing any page other than the root will return a 404 error — the server will try to find a static file at that path and find nothing.

Building for production

Run the build command to generate the production bundle:
npm run build
Vite compiles and minifies all JavaScript, CSS, and assets into the dist/ directory. You can verify the build locally before deploying:
npm run preview
This serves the dist/ output at http://localhost:4173.

Netlify

1

Build the project

Run the production build to generate the dist/ output:
npm run build
2

Configure build settings in Netlify

In your Netlify site settings, set the following build configuration:
SettingValue
Build commandnpm run build
Publish directorydist
If you connect Netlify to the GitHub repository, Netlify will run the build automatically on every push to the main branch.
3

Add the SPA redirect rule

Create a netlify.toml file at the root of the repository with the following content:
netlify.toml
[[redirects]]
  from = "/*"
  to = "/index.html"
  status = 200
This tells Netlify to serve index.html for every request, allowing React Router to handle the routing on the client side.
4

Deploy

Push your changes to GitHub. Netlify will detect the push, run npm run build, and publish the dist/ directory. The updated site is live within seconds.

netlify.toml reference

A minimal netlify.toml for this project:
netlify.toml
[build]
  command = "npm run build"
  publish = "dist"

[[redirects]]
  from = "/*"
  to = "/index.html"
  status = 200

Other hosting options

Vercel detects Vite projects automatically and sets the correct build command and output directory.
  1. Import the repository from GitHub in the Vercel dashboard.
  2. Vercel sets npm run build and dist by default — no changes needed.
  3. Add a vercel.json file for the SPA redirect:
vercel.json
{
  "rewrites": [
    { "source": "/(.*)", "destination": "/index.html" }
  ]
}

Build docs developers (and LLMs) love