diff --git a/client/.gitignore b/client/.gitignore new file mode 100644 index 0000000..a547bf3 --- /dev/null +++ b/client/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/client/README.md b/client/README.md new file mode 100644 index 0000000..998688d --- /dev/null +++ b/client/README.md @@ -0,0 +1,15 @@ +# `create-preact` + +
{props.description}
+ + ); +} + +function ApiData({ endpoint, title }) { + const [data, setData] = useState(null); + + const fetchData = () => { + fetch(`https://web-production-aae7.up.railway.app${endpoint}`) + .then(response => response.json()) + .then(data => setData(data)) + .catch(error => console.error('Error fetching data:', error)); + }; + + return ( +{JSON.stringify(data, null, 2)}
+ ) : (
+ Click the button to load data
+ )} +{JSON.stringify(data, null, 2)}
+ ) : (
+ Enter a query and click the button to search
+ )} +{JSON.stringify(data, null, 2)}
+ ) : (
+ Enter a prompt and click the button to submit
+ )} +{JSON.stringify(data, null, 2)}
+ ) : (
+ Enter a Mitzvah ID and click the button to explain
+ )} +