The backend API server must be publicly accessible on the internet before you deploy the frontend. The deployed app will make requests to the URL you set in
VITE_API_URL — if the backend is unreachable, all data operations will fail.Prerequisites
- A Netlify account
- The project repository hosted on GitHub, GitLab, or Bitbucket
- A running, publicly accessible backend API
Deploy steps
1
Connect your repository
- Log in to Netlify and click Add new site → Import an existing project.
- Choose your Git provider and authorize Netlify to access your repositories.
- Select the
Vacaciones-frontrepository.
2
Configure build settings
Netlify reads
netlify.toml from the repository root and pre-fills the build settings automatically. Confirm the following values are set:npm run build runs vite build, which compiles the app into the dist folder.3
Set environment variables
Before deploying, add your production environment variables so Vite can embed them in the build.
- In the Netlify site settings, go to Site configuration → Environment variables.
- Click Add a variable and add the following:
4
Deploy the site
Click Deploy site. Netlify will clone the repository, install dependencies, run
npm run build, and publish the dist folder.You can monitor build progress in the Deploys tab of your site dashboard.SPA redirect rule
React Router handles navigation on the client side. Without a redirect rule, navigating directly to a URL such as/vacaciones/list returns a 404 from Netlify’s CDN because no file exists at that path.
The netlify.toml in the repository root includes the required redirect rule:
status = 200 (rewrite) means Netlify serves index.html for every route while keeping the original URL in the browser. React Router then renders the correct page. No manual configuration is needed — the file is committed to the repository and Netlify picks it up automatically.
