File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Global build environment settings
12[build .environment ]
2- NODE_VERSION = " 20"
3- SECRETS_SCAN_OMIT_KEYS = " VITE_API_URL,VITE_GEOAPIFY_API_KEY"
3+ NODE_VERSION = " 20"
4+ PNPM_VERSION = " 8" # Good practice to specify the pnpm version
5+ SECRETS_SCAN_OMIT_KEYS = " VITE_API_URL,VITE_GEOAPIFY_API_KEY"
46
7+ # --- Frontend App Build Configuration ---
8+ # This tells Netlify how to build your static React application.
59[build ]
6- base = " frontend"
7- command = " pnpm install && pnpm run build"
8- publish = " dist"
10+ base = " frontend" # Netlify will `cd` into the 'frontend' directory first.
11+ command = " pnpm install && pnpm run build" # Then, it runs the build command for your React app.
12+ publish = " frontend/ dist" # The output directory for the static site, relative to the repo root.
913
14+ # --- Serverless Functions Configuration ---
15+ # This tells Netlify where to find your backend API endpoints.
16+ [functions ]
17+ directory = " netlify/functions" # Directory for serverless functions, relative to the repo root.
18+
19+ # --- Redirects and Rewrites ---
20+
21+ # This rule makes your serverless function available at a cleaner URL.
22+ # Instead of calling `/.netlify/functions/predict`, your frontend can call `/api/predict`.
23+ [[redirects ]]
24+ from = " /api/*"
25+ to = " /.netlify/functions/:splat"
26+ status = 200
27+
28+ # This rule is crucial for Single-Page Applications (SPAs) like React.
29+ # It ensures that all paths are served by index.html, allowing React Router to work.
1030[[redirects ]]
11- from = " /*"
12- to = " /index.html"
13- status = 200
31+ from = " /*"
32+ to = " /index.html"
33+ status = 200
You can’t perform that action at this time.
0 commit comments