- Refactor BevyScene to replace script injection with dynamic import.

- Update `NavItem` to provide fallback route for invalid `path`.
- Temporarily stub metric API endpoints with placeholders.
This commit is contained in:
geoffsee
2025-07-01 12:28:44 -04:00
committed by Geoff Seemueller
parent 0ff8b5c03e
commit 3901337163
3 changed files with 20 additions and 12 deletions

View File

@@ -9,13 +9,19 @@ export interface BevySceneProps {
export const BevyScene: React.FC<BevySceneProps> = ({ speed = 1, intensity = 1, glow = false }) => {
useEffect(() => {
const script = document.createElement('script');
script.src = '/yachtpit.js';
script.type = 'module';
document.body.appendChild(script);
script.onload = loaded => {
console.log('loaded', loaded);
};
(async () => {
const module = await import('/public/yachtpit.js', { type: 'module' });
console.log('init', module);
await module.default();
})();
// const script = document.createElement('script');
// script.src = '';
// script.type = 'module';
// document.body.appendChild(script);
// script.onload = loaded => {
// loaded.target?.init();
// console.log('loaded', loaded);
// };
}, []);
return (

View File

@@ -5,7 +5,7 @@ function NavItem({ path, children, color, onClick, as, cursor }) {
return (
<Box
as={as ?? 'a'}
href={path}
href={path && path.length > 1 ? path : '/'}
mb={2}
cursor={cursor}
// ml={5}

View File

@@ -52,13 +52,15 @@ export function createRouter() {
// })
.get('/api/metrics*', async (r, e, c) => {
const { metricsService } = createRequestContext(e, c);
return metricsService.handleMetricsRequest(r);
return new Response('ok');
// const { metricsService } = createRequestContext(e, c);
// return metricsService.handleMetricsRequest(r);
})
.post('/api/metrics*', async (r, e, c) => {
const { metricsService } = createRequestContext(e, c);
return metricsService.handleMetricsRequest(r);
return new Response('ok');
// const { metricsService } = createRequestContext(e, c);
// return metricsService.handleMetricsRequest(r);
})
// renders the app