diff --git a/src/pages/Main/index.tsx b/src/pages/Main/index.tsx index c6e89dc..1a90547 100644 --- a/src/pages/Main/index.tsx +++ b/src/pages/Main/index.tsx @@ -4,15 +4,14 @@ import { useQuery } from "@tanstack/react-query"; import React from "react"; export default function Main() { - const { data: test } = useQuery([QueryKeys.TEST], () => - restFetcher({ method: "GET", path: "test" }), - ); - const { data: product } = useQuery(["PRODUCT"], () => + const { data: product } = useQuery([QueryKeys.TEST], () => restFetcher({ method: "GET", path: "/product" }), ); return (
-

{test}

+

+ {JSON.stringify(product)} +

{JSON.stringify(product)}

diff --git a/src/queryClient.ts b/src/queryClient.ts index 110409d..305a479 100644 --- a/src/queryClient.ts +++ b/src/queryClient.ts @@ -26,7 +26,7 @@ export const getClient = (() => { })(); const { VITE_BASE_URL } = import.meta.env; -const BASE_URL = VITE_BASE_URL || "/"; +const BASE_URL = VITE_BASE_URL || "http://localhost:8000/api"; export const restFetcher = async ({ method, diff --git a/src/types/test.ts b/src/types/test.ts index 67c8f1a..8b9f93d 100644 --- a/src/types/test.ts +++ b/src/types/test.ts @@ -1 +1,7 @@ -export type Test = string; +export type Test = { + id: number; + name: string; + point: string; + bloom: string; + toxin: string; +}; diff --git a/vite.config.ts b/vite.config.ts index 6e7082b..25d5989 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -9,9 +9,6 @@ export default defineConfig({ server: { port: 3000, host: true, - proxy: { - "/api": "http://localhost:8001", - }, }, resolve: { alias: {