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 ( -
Error: {healthStatus.error}
-Environment Check:
-- Please check your environment variables and database setup. -
-If you can see this, basic routing is working.
+Current time: {new Date().toISOString()}
+