diff --git a/ui/pages/index.tsx b/ui/pages/index.tsx index b7bb42f..28a58d5 100644 --- a/ui/pages/index.tsx +++ b/ui/pages/index.tsx @@ -1,9 +1,25 @@ import type { NextPage } from "next"; +import { useState, useEffect } from "react"; + +const backUrl = "http://localhost:3001"; const Home: NextPage = () => { + const [hello, setHello] = useState("nothing"); + + useEffect(() => { + console.log("fetching...", backUrl); + fetch(backUrl, { credentials: "include" }) + .then((res) => res.json()) + .then((data) => { + console.log("back data:", data); + setHello(data); + }); + }, []); + return ( <>

Home

+

Hello from back? {hello}

); };