arbret/frontend/app/page.tsx
2025-12-18 21:37:28 +01:00

21 lines
466 B
TypeScript

"use client";
import { useEffect, useState } from "react";
export default function Home() {
const [message, setMessage] = useState("");
useEffect(() => {
fetch("http://localhost:8000/api/hello")
.then((res) => res.json())
.then((data) => setMessage(data.message));
}, []);
return (
<main style={{ padding: "2rem", fontFamily: "system-ui" }}>
<h1>FastAPI + Next.js</h1>
<p>{message || "Loading..."}</p>
</main>
);
}