From 610f64a5fb2a6368a6007e0667735f4ad4034854 Mon Sep 17 00:00:00 2001 From: mina-gwak Date: Sat, 17 May 2025 17:29:41 +0900 Subject: [PATCH 1/6] =?UTF-8?q?vercel.json=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vercel.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vercel.json b/vercel.json index da3b6c2..44a19f4 100644 --- a/vercel.json +++ b/vercel.json @@ -1,8 +1,8 @@ { "rewrites": [ { - "source": "/api/:path*", - "destination": "https://dev.back.plus82.co/api/:path*" + "source": "/api/(.*)", + "destination": "https://dev.back.plus82.co/api/$1" }, { "source": "/(.*)", "destination": "/" } ] From 2d56162564f6b9b6a8ff29ad8985792518ad8db0 Mon Sep 17 00:00:00 2001 From: mina-gwak Date: Sat, 17 May 2025 17:44:19 +0900 Subject: [PATCH 2/6] =?UTF-8?q?headers=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vercel.json | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/vercel.json b/vercel.json index 44a19f4..da3106e 100644 --- a/vercel.json +++ b/vercel.json @@ -1,8 +1,19 @@ { - "rewrites": [ + "headers": [ { "source": "/api/(.*)", - "destination": "https://dev.back.plus82.co/api/$1" + "headers": [ + { "key": "Access-Control-Allow-Origin", "value": "https://dev.admin.plus82.co" }, + { "key": "Access-Control-Allow-Methods", "value": "GET, POST, OPTIONS" }, + { "key": "Access-Control-Allow-Headers", "value": "Content-Type, Authorization" }, + { "key": "Access-Control-Allow-Credentials", "value": "true" } + ] + } + ], + "rewrites": [ + { + "source": "/api/:path*", + "destination": "https://dev.back.plus82.co/api/:path*" }, { "source": "/(.*)", "destination": "/" } ] From 263fbe975b0a3d5b70ccc785f613e8b6ba2b2d88 Mon Sep 17 00:00:00 2001 From: mina-gwak Date: Sat, 17 May 2025 18:28:07 +0900 Subject: [PATCH 3/6] =?UTF-8?q?origin=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vercel.json | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/vercel.json b/vercel.json index da3106e..7cfa07b 100644 --- a/vercel.json +++ b/vercel.json @@ -3,9 +3,18 @@ { "source": "/api/(.*)", "headers": [ - { "key": "Access-Control-Allow-Origin", "value": "https://dev.admin.plus82.co" }, - { "key": "Access-Control-Allow-Methods", "value": "GET, POST, OPTIONS" }, - { "key": "Access-Control-Allow-Headers", "value": "Content-Type, Authorization" }, + { + "key": "Access-Control-Allow-Origin", + "value": "https://www.dev.admin.plus82.co" + }, + { + "key": "Access-Control-Allow-Methods", + "value": "GET, POST, OPTIONS" + }, + { + "key": "Access-Control-Allow-Headers", + "value": "Content-Type, Authorization" + }, { "key": "Access-Control-Allow-Credentials", "value": "true" } ] } From 356b28d21fc82a691bcd70ea5cf712842c87d32e Mon Sep 17 00:00:00 2001 From: mina-gwak Date: Sat, 17 May 2025 18:36:35 +0900 Subject: [PATCH 4/6] =?UTF-8?q?vercel.json=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vercel.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vercel.json b/vercel.json index 7cfa07b..6098c9c 100644 --- a/vercel.json +++ b/vercel.json @@ -24,6 +24,6 @@ "source": "/api/:path*", "destination": "https://dev.back.plus82.co/api/:path*" }, - { "source": "/(.*)", "destination": "/" } + { "source": "/(.*)", "destination": "/index.html" } ] } From 5ed85c78588372a2f00949cf5f6101c2c1f69ebb Mon Sep 17 00:00:00 2001 From: mina-gwak Date: Sat, 17 May 2025 19:22:23 +0900 Subject: [PATCH 5/6] =?UTF-8?q?=EB=A1=9C=EA=B7=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/auth/request.ts | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/src/api/auth/request.ts b/src/api/auth/request.ts index a1290df..034c974 100644 --- a/src/api/auth/request.ts +++ b/src/api/auth/request.ts @@ -1,30 +1,27 @@ -import http from "../instance"; +import http from '../instance' -import type { SignInRequest, SignInResponse } from "../../type/auth"; +import type { SignInRequest, SignInResponse } from '../../type/auth' // API 엔드포인트 const AUTH_API = { - BASE: "/auth", - SIGN_IN: "/admin/sign-in", -}; + BASE: '/auth/admin/sign-in', +} // API 함수들 export const authApi = { - // 로그인 - signIn: async ( - data: SignInRequest - ): Promise => { + signIn: async (data: SignInRequest): Promise => { try { const response = await http.post({ - url: AUTH_API.BASE + AUTH_API.SIGN_IN, + url: AUTH_API.BASE, data, useAuth: false, - }); - return response; - } catch { + }) + return response + } catch (error) { + console.log(error) // TODO : responseCode 분기 - throw new Error("로그인 실패"); + throw new Error('로그인 실패') } - } -} \ No newline at end of file + }, +} From 1a056011ce9487c72f49479286ae33bd54ee73e0 Mon Sep 17 00:00:00 2001 From: mina-gwak Date: Tue, 20 May 2025 01:15:54 +0900 Subject: [PATCH 6/6] =?UTF-8?q?Fix:=20cloudfront=20=ED=94=84=EB=A1=9D?= =?UTF-8?q?=EC=8B=9C=20=EC=84=A4=EC=A0=95=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/resume/[id]/component/pdf-viewer/index.tsx | 5 ++--- vercel.json | 4 ++++ vite.config.ts | 11 ++++++----- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/page/resume/[id]/component/pdf-viewer/index.tsx b/src/page/resume/[id]/component/pdf-viewer/index.tsx index fe6e962..7580ea0 100644 --- a/src/page/resume/[id]/component/pdf-viewer/index.tsx +++ b/src/page/resume/[id]/component/pdf-viewer/index.tsx @@ -6,8 +6,7 @@ import { Document, Page, pdfjs } from 'react-pdf' import { Spinner } from '@/shared/component/spinner' import { cn } from '@/shared/lib/util' -pdfjs.GlobalWorkerOptions.workerSrc = `//unpkg.com/pdfjs-dist@${pdfjs.version}/build/pdf.worker.min.mjs`; - +pdfjs.GlobalWorkerOptions.workerSrc = `//unpkg.com/pdfjs-dist@${pdfjs.version}/build/pdf.worker.min.mjs` type Props = { className?: string @@ -26,7 +25,7 @@ export const PDFViewer = ({ filePath, className, width = 800 }: Props) => {
} diff --git a/vercel.json b/vercel.json index 6098c9c..223c2b3 100644 --- a/vercel.json +++ b/vercel.json @@ -24,6 +24,10 @@ "source": "/api/:path*", "destination": "https://dev.back.plus82.co/api/:path*" }, + { + "source": "/cdn/:path*", + "destination": "https://d1zl1w0yhwh5x4.cloudfront.net/:path*" + }, { "source": "/(.*)", "destination": "/index.html" } ] } diff --git a/vite.config.ts b/vite.config.ts index a863f5e..b8dc888 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,13 +1,13 @@ -import react from "@vitejs/plugin-react"; -import { defineConfig } from "vite"; -import svgr from "vite-plugin-svgr"; +import react from '@vitejs/plugin-react' +import { defineConfig } from 'vite' +import svgr from 'vite-plugin-svgr' // https://vite.dev/config/ export default defineConfig({ plugins: [react(), svgr()], resolve: { alias: { - "@": "/src", + '@': '/src', }, }, server: { @@ -19,8 +19,9 @@ export default defineConfig({ '/cdn': { target: `https://d1zl1w0yhwh5x4.cloudfront.net`, changeOrigin: true, + rewrite: path => path.replace(/^\/cdn/, ''), }, }, port: 3000, }, -}); +})