From 508ddb75c9ca4fc8cbdae8db01d6b86059034266 Mon Sep 17 00:00:00 2001 From: SeungGwa123 Date: Thu, 21 Nov 2024 18:13:03 +0900 Subject: [PATCH] fix: deploy fix --- package.json | 1 - packages/client/package.json | 1 - packages/client/src/api/instance.ts | 5 +---- packages/client/src/hooks/SSE/useSSEOrderbook.ts | 5 +---- packages/client/src/hooks/SSE/useSSETicker.ts | 5 +---- yarn.lock | 2 -- 6 files changed, 3 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index 689c689f..17d9fd3b 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,6 @@ "@nestjs/websockets": "^10.4.7", "class-transformer": "^0.5.1", "class-validator": "^0.14.1", - "dotenv": "^16.4.5", "ws": "^8.18.0" } } diff --git a/packages/client/package.json b/packages/client/package.json index 5d865362..2dc17e70 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -13,7 +13,6 @@ "@material-tailwind/react": "^2.1.10", "@tanstack/react-query": "^5.59.19", "axios": "^1.7.7", - "dotenv": "^16.4.5", "lightweight-charts": "^4.2.1", "lodash": "^4.17.21", "lottie-react": "^2.4.0", diff --git a/packages/client/src/api/instance.ts b/packages/client/src/api/instance.ts index 30560f7b..1975fadf 100644 --- a/packages/client/src/api/instance.ts +++ b/packages/client/src/api/instance.ts @@ -1,10 +1,7 @@ import axios from 'axios'; -import {config} from 'dotenv' - -config(); export const instance = axios.create({ - baseURL: process.env.VITE_API_BASE_URL, + baseURL: import.meta.env.VITE_API_BASE_URL, withCredentials: true, timeout: 2000, }); diff --git a/packages/client/src/hooks/SSE/useSSEOrderbook.ts b/packages/client/src/hooks/SSE/useSSEOrderbook.ts index 58d2ab34..353d6668 100644 --- a/packages/client/src/hooks/SSE/useSSEOrderbook.ts +++ b/packages/client/src/hooks/SSE/useSSEOrderbook.ts @@ -1,11 +1,8 @@ import { SSEOrderBook } from '@/types/orderbook'; import { useRef, useState, useEffect } from 'react'; -import {config} from 'dotenv' - -config(); export function useSSEOrderbook(targetMarketCodes: { market: string }[]) { - const BASE_URL = `${process.env.VITE_API_BASE_URL}/upbit/orderbook`; + const BASE_URL = `${import.meta.env.VITE_API_BASE_URL}/upbit/orderbook`; const eventSource = useRef(null); const [isConnected, setIsConnected] = useState(false); const [sseData, setSSEData] = useState(); diff --git a/packages/client/src/hooks/SSE/useSSETicker.ts b/packages/client/src/hooks/SSE/useSSETicker.ts index fa099557..3e892c6f 100644 --- a/packages/client/src/hooks/SSE/useSSETicker.ts +++ b/packages/client/src/hooks/SSE/useSSETicker.ts @@ -1,11 +1,8 @@ import { SSEDataType } from '@/types/ticker'; import { useEffect, useRef, useState } from 'react'; -import {config} from 'dotenv' - -config(); export function useSSETicker(targetMarketCodes: { market: string }[]) { - const BASE_URL = `${process.env.VITE_API_BASE_URL}/upbit/price-updates`; + const BASE_URL = `${import.meta.env.VITE_API_BASE_URL}/upbit/price-updates`; const eventSource = useRef(null); const [isConnected, setIsConnected] = useState(false); const [sseData, setSSEData] = useState(); diff --git a/yarn.lock b/yarn.lock index 996be416..a029d66c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3870,7 +3870,6 @@ __metadata: "@vitejs/plugin-react": "npm:^4.3.3" autoprefixer: "npm:^10.4.20" axios: "npm:^1.7.7" - dotenv: "npm:^16.4.5" eslint: "npm:^9.13.0" eslint-plugin-react-hooks: "npm:^5.0.0" eslint-plugin-react-refresh: "npm:^0.4.13" @@ -10157,7 +10156,6 @@ __metadata: "@nestjs/websockets": "npm:^10.4.7" class-transformer: "npm:^0.5.1" class-validator: "npm:^0.14.1" - dotenv: "npm:^16.4.5" eslint: "npm:^8.0.0" eslint-config-prettier: "npm:^9.1.0" prettier: "npm:^3.3.3"