diff --git a/frontend/chat-ui/src/aws-amplify.js b/frontend/chat-ui/src/aws-amplify.js new file mode 100644 index 0000000..72abb65 --- /dev/null +++ b/frontend/chat-ui/src/aws-amplify.js @@ -0,0 +1,5 @@ +export const Amplify = { + configure() { + // No-op stub used when aws-amplify package is unavailable. + } +} diff --git a/frontend/chat-ui/src/components/TestApi.jsx b/frontend/chat-ui/src/components/TestApi.jsx index 4379418..9c9165e 100644 --- a/frontend/chat-ui/src/components/TestApi.jsx +++ b/frontend/chat-ui/src/components/TestApi.jsx @@ -1,18 +1,18 @@ -import React, { useState } from 'react'; -import api from '../api'; +import React, { useState } from 'react' +import api from '../api' export default function TestApi() { - const [resp, setResp] = useState(null); - const [err, setErr] = useState(null); + const [resp, setResp] = useState(null) + const [err, setErr] = useState(null) async function hit() { try { - setErr(null); - const data = await api.get('/health'); - setResp(JSON.stringify(data, null, 2)); + setErr(null) + const data = await api.get('/health') + setResp(JSON.stringify(data, null, 2)) } catch (e) { - setResp(null); - setErr(e.message || String(e)); + setResp(null) + setErr(e.message || String(e)) } } @@ -24,31 +24,5 @@ export default function TestApi() { {err &&
{err}}
{resp && {resp}}
- );
-}
-import React, { useState } from 'react';
-import api from '../api';
-
-export default function TestApi() {
- const [resp, setResp] = useState();
- const [err, setErr] = useState();
-
- async function hit() {
- try {
- const data = await api.get('/health'); // or whatever route you have
- setResp(JSON.stringify(data, null, 2));
- setErr(null);
- } catch (e) {
- setErr(e.message || 'error');
- setResp(null);
- }
- }
-
- return (
- {err}}
- {resp && {resp}}
-