Fix production data fetching with static JSON

- Add build-time data fetching from Confluence
- Create build-data.js script to fetch and save data at build time
- Update App.tsx to use static JSON in production, API in development
- Install tsx for running TypeScript build scripts
- Configure Amplify to fetch data during build process
- Add public directory configuration to Vite

This fixes the white page error by providing data at build time instead of runtime.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
DaX
2025-06-19 00:00:26 +02:00
parent 63f973ccf1
commit 4b39190251
7 changed files with 940 additions and 677 deletions

View File

@@ -27,7 +27,9 @@ function App() {
setLoading(true);
setError(null);
const response = await axios.get('/api/filaments');
// In development, use the API endpoint; in production, use the static JSON
const url = import.meta.env.DEV ? '/api/filaments' : '/filaments.json';
const response = await axios.get(url);
setFilaments(response.data);
setLastUpdate(new Date());
} catch (err) {