File size: 723 Bytes
a3e20c4
 
ad5d266
94f1dbe
 
a3e20c4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94f1dbe
 
ad5d266
a3e20c4
 
94f1dbe
ad5d266
94f1dbe
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"use client";

import Link from "next/link";

export default function Home() {
  async function start() {
    const resp = await fetch(
      `${process.env.API_URL || "http://localhost:8000"}/start`,
      {
        method: "POST",
        mode: "cors",
        cache: "no-cache",
        credentials: "same-origin",
        headers: {
          "Content-Type": "application/json",
        },
        body: JSON.stringify({}),
      }
    );

    const data = await resp.json();
    console.log(data);
  }

  return (
    <main className="flex min-h-screen flex-col items-center justify-between p-24">
      <Link href="/test">Test</Link>
      <hr />
      <span onClick={() => start()}>Connect</span>
    </main>
  );
}