-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.ts
More file actions
35 lines (32 loc) · 1019 Bytes
/
next.config.ts
File metadata and controls
35 lines (32 loc) · 1019 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import type { NextConfig } from "next";
// /api 프록시 타겟: .env의 NEXT_PUBLIC_API_URL 사용 (없으면 기본 API 도메인)
// - 예: NEXT_PUBLIC_API_URL=https://localhost:8443
// - 예: NEXT_PUBLIC_API_URL=https://dev.api.example.com/api (베이스 경로 포함 가능)
const API_BASE_URL = (
process.env.NEXT_PUBLIC_API_URL || "https://api.senifit.co.kr:8443"
)
.trim()
.replace(/\/+$/, ""); // trailing slash 제거
const nextConfig: NextConfig = {
eslint: { ignoreDuringBuilds: true },
typescript: { ignoreBuildErrors: true },
images: {
remotePatterns: [
{ protocol: "https", hostname: "api.senifit.co.kr", port: "8443" },
{ protocol: "https", hostname: "picsum.photos" },
{
protocol: "https",
hostname: "senifit-program-bk.s3.ap-northeast-2.amazonaws.com",
},
],
},
async rewrites() {
return [
{
source: "/api/:path*",
destination: `${API_BASE_URL}/:path*`,
},
];
},
};
export default nextConfig;