From 0ccdd7e2b4d3afd872fa075cabd6ffe8aaaa919d Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Sat, 21 Jun 2025 19:23:44 +0200 Subject: [PATCH] yay2 --- pages/api/test.js | 8 +++++++ pages/index.js | 54 ----------------------------------------------- pages/test.js | 9 ++++++++ 3 files changed, 17 insertions(+), 54 deletions(-) create mode 100644 pages/api/test.js create mode 100644 pages/test.js diff --git a/pages/api/test.js b/pages/api/test.js new file mode 100644 index 0000000..6bedbe7 --- /dev/null +++ b/pages/api/test.js @@ -0,0 +1,8 @@ +export default function handler(req, res) { + res.status(200).json({ + message: 'API is working!', + timestamp: new Date().toISOString(), + method: req.method, + url: req.url + }) +} \ No newline at end of file diff --git a/pages/index.js b/pages/index.js index e7779e6..e385cb6 100644 --- a/pages/index.js +++ b/pages/index.js @@ -1,6 +1,5 @@ import Head from 'next/head' import dynamic from 'next/dynamic' -import { useState, useEffect } from 'react' // Dynamically import the chess app to avoid SSR issues with Pusher const ChessApp = dynamic(() => import('../components/ChessApp'), { @@ -17,59 +16,6 @@ const ChessApp = dynamic(() => import('../components/ChessApp'), { }) export default function Home() { - const [healthStatus, setHealthStatus] = useState(null) - const [loading, setLoading] = useState(true) - - useEffect(() => { - // Check API health on mount - fetch('/api/health') - .then(res => res.json()) - .then(data => { - setHealthStatus(data) - setLoading(false) - }) - .catch(error => { - console.error('Health check failed:', error) - setHealthStatus({ status: 'error', error: error.message }) - setLoading(false) - }) - }, []) - - if (loading) { - return ( -
-
-
🍄
-
Checking system health...
-
-
- ) - } - - if (healthStatus?.status === 'unhealthy') { - return ( -
-
-
⚠️
-

System Error

-
-

Error: {healthStatus.error}

-

Environment Check:

-
    -
  • Supabase URL: {healthStatus.environment?.hasSupabaseUrl ? '✅' : '❌'}
  • -
  • Supabase Key: {healthStatus.environment?.hasSupabaseKey ? '✅' : '❌'}
  • -
  • Pusher Key: {healthStatus.environment?.hasPusherKey ? '✅' : '❌'}
  • -
  • Pusher Cluster: {healthStatus.environment?.hasPusherCluster ? '✅' : '❌'}
  • -
-
-

- Please check your environment variables and database setup. -

-
-
- ) - } - return ( <> diff --git a/pages/test.js b/pages/test.js new file mode 100644 index 0000000..d33e91e --- /dev/null +++ b/pages/test.js @@ -0,0 +1,9 @@ +export default function TestPage() { + return ( +
+

Test Page Working!

+

If you can see this, basic routing is working.

+

Current time: {new Date().toISOString()}

+
+ ) +} \ No newline at end of file