Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions ui/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -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<string>("nothing");

useEffect(() => {
console.log("fetching...", backUrl);
fetch(backUrl, { credentials: "include" })
.then((res) => res.json())
.then((data) => {
console.log("back data:", data);
setHello(data);
});
}, []);

return (
<>
<h1>Home</h1>
<p>Hello from back? {hello}</p>
</>
);
};
Expand Down