import logo from "./logo.svg";
import "./App.css";

function App() {
  const handleTestClick = () => {
    fetch("http://localhost:3001/hello_json")
      .then((res) => res.json())
      .then((res_json) => console.log(res_json));
  };

  const handleWriteSession = () => {
    fetch("http://localhost:3001/write_session", {
      credentials: "include",
    })
      .then((res) => res.json())
      .then((res_json) => console.log(res_json));
  };

  const handleReadSession = () => {
    fetch("http://localhost:3001/read_session", {
      credentials: "include",
    })
      .then((res) => res.json())
      .then((res_json) => console.log(res_json));
  };

  return (
    <>
      <button onClick={(e) => handleTestClick(e)}>test</button>
      <button onClick={(e) => handleWriteSession(e)}>write_session</button>
      <button onClick={(e) => handleReadSession(e)}>read_session</button>
      helloworld
    </>
  );
}

export default App;
