From 3c28bc1cf36db3736faa8b8d7f9f1b5ef2f5427f Mon Sep 17 00:00:00 2001 From: sangminlee98 Date: Fri, 6 Jan 2023 21:09:34 +0900 Subject: [PATCH] =?UTF-8?q?chore=20:=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20API?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80=20=EB=B0=8F=20proxy=20=EC=BD=94=EB=93=9C?= =?UTF-8?q?=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Main/index.tsx | 9 ++++----- src/queryClient.ts | 2 +- src/types/test.ts | 8 +++++++- vite.config.ts | 3 --- 4 files changed, 12 insertions(+), 10 deletions(-) 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: {