-
Notifications
You must be signed in to change notification settings - Fork 4
배포된 백엔드 api와 연결 #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
배포된 백엔드 api와 연결 #47
Changes from 3 commits
eebdd61
400e6a1
e4881f0
4f0e813
f6a60ec
b5d7dc9
24e1701
9082496
59ca8bd
f0cdd66
98a1630
a87acde
74df95a
5ae469c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| # Copy this file to .env.local and set variables as needed. | ||
| # If unset, Next.js rewrites fall back to http://127.0.0.1:8000. | ||
| BACKEND_URL= | ||
| # If unset, frontend requests default to https://primerflow-be.onrender.com. | ||
| NEXT_PUBLIC_API_BASE_URL= |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,5 @@ | ||
| import type { NextConfig } from "next"; | ||
|
|
||
| const nextConfig: NextConfig = { | ||
| // ... 기타 설정들 ... | ||
|
|
||
| async rewrites() { | ||
| // BACKEND_URL 값이 없으면 로컬(8000)로 연결 | ||
| const backendUrl = process.env.BACKEND_URL || "http://127.0.0.1:8000"; | ||
|
|
||
| return [ | ||
| { | ||
| source: "/api/v1/:path*", | ||
| destination: `${backendUrl}/:path*`, // 여기를 변수로 변경 | ||
| }, | ||
| ]; | ||
| }, | ||
| }; | ||
| const nextConfig: NextConfig = {}; | ||
|
|
||
| export default nextConfig; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,14 @@ | ||
| import axios from "axios"; | ||
|
|
||
| const DEFAULT_API_BASE_URL = "https://primerflow-be.onrender.com"; | ||
| const apiBaseUrl = | ||
| process.env.NEXT_PUBLIC_API_BASE_URL?.trim() || DEFAULT_API_BASE_URL; | ||
|
|
||
| export const apiClient = axios.create({ | ||
| // 모든 API 호출을 /api/v1 이하 상대 경로로 강제합니다. | ||
| baseURL: "/api/v1", | ||
| baseURL: apiBaseUrl, | ||
| headers: { | ||
|
||
| "Content-Type": "application/json", | ||
| }, | ||
| // 필요한 경우 쿠키 공유를 위해 아래 옵션을 사용하세요. | ||
| // withCredentials: true, | ||
| }); | ||
|
|
||
| export const api = apiClient; | ||
|
|
||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,11 +52,11 @@ export interface AnalyzeRequestInput { | |
|
|
||
| // Adapter: flat UI -> official request schema | ||
| const toPrimerDesignRequest = (input: AnalyzeRequestInput): PrimerDesignRequest => { | ||
| const seq = input.target_sequence || input.templateSequence || "ATGC"; | ||
| const seq = input.target_sequence || input.templateSequence || ""; | ||
| const searchFrom = input.search_start ?? 1; | ||
| const searchTo = | ||
| input.search_end ?? | ||
| searchFrom + (seq?.length || 1000); | ||
| searchFrom + Math.max(seq.length - 1, 0); | ||
|
|
||
|
||
| return { | ||
| basic: { | ||
|
|
@@ -224,7 +224,7 @@ export const analyzeGenome = async ( | |
|
|
||
| console.log("🚀 Sending Payload:", payload); | ||
|
|
||
| const response = await api.post<PrimerDesignResponse>("/primer/design", payload); | ||
| const response = await api.post<PrimerDesignResponse>("/design", payload); | ||
| const rawData = response.data; | ||
|
|
||
| const transformed = toUiResponse(rawData); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기서 사용자에게 노출되는 에러 메시지가 영어로 표시되고 있는데, 같은 파일의 다른 검증/경고 메시지는 한국어로 제공되고 있습니다. 사용자 경험 일관성을 위해 한국어 메시지로 통일하거나(또는 i18n/상수로 분리) 기존 메시지 스타일에 맞춰 주세요.