[st] chore: NEXT_PUBLIC_SERVER_API_URL -> SERVER_API_URL 변경

This commit is contained in:
2026-04-16 09:34:55 +09:00
parent a1f02d3717
commit b1beff9ef0
3 changed files with 135 additions and 123 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
# apps/cs/src/shared/config/env.ts 참고 # apps/cs/src/shared/config/env.ts 참고
NEXT_PUBLIC_PORT=3000 NEXT_PUBLIC_PORT=3000
NEXT_PUBLIC_PROXY_HOST=http://localhost:3000 NEXT_PUBLIC_PROXY_HOST=http://localhost:3000
SERVER_API_URL=http://192.168.0.102:8000
NEXT_PUBLIC_SITE_ID=CS NEXT_PUBLIC_SITE_ID=CS
NEXT_PUBLIC_SUB_DOMAIN=http://localhost:3000 NEXT_PUBLIC_SUB_DOMAIN=http://localhost:3000
NEXT_PUBLIC_SERVER_API_URL=http://192.168.0.102:8000
NEXT_PUBLIC_TINY_API_KEY=t9nc4z6inquvvd5pq1vea8wcp7lb01qmqseh6egms9vpaju2 NEXT_PUBLIC_TINY_API_KEY=t9nc4z6inquvvd5pq1vea8wcp7lb01qmqseh6egms9vpaju2
+19 -7
View File
@@ -1,7 +1,8 @@
import { NextRequest, NextResponse } from "next/server"; import { NextRequest, NextResponse } from "next/server";
import { import {
CLAIM_NAME,
AUTH_USER_ID, AUTH_USER_ID,
CLAIM_NAME,
PORT, PORT,
PROXY_HOST, PROXY_HOST,
SERVER_API_URL, SERVER_API_URL,
@@ -9,16 +10,19 @@ import {
ST_SERVICE_URL, ST_SERVICE_URL,
} from "./src/shared/config"; } from "./src/shared/config";
const serverApiUrl = const serverApiUrl = process.env.SERVER_API_URL ?? "http://localhost:3000";
process.env.NEXT_PUBLIC_SERVER_API_URL ?? "http://localhost:3000";
const stServiceUrl = ST_SERVICE_URL; const stServiceUrl = ST_SERVICE_URL;
const linkBackendApiHost = process.env.NEXT_PUBLIC_LINK_BACKEND_API_HOST ?? "http://localhost:8080"; const linkBackendApiHost =
process.env.NEXT_PUBLIC_LINK_BACKEND_API_HOST ?? "http://localhost:8080";
// CSP 헤더 설정 함수 (img-src만) // CSP 헤더 설정 함수 (img-src만)
function addSecurityHeaders(response: NextResponse): NextResponse { function addSecurityHeaders(response: NextResponse): NextResponse {
response.headers.set("Content-Security-Policy", "img-src 'self' data: https: blob:;"); response.headers.set(
"Content-Security-Policy",
"img-src 'self' data: https: blob:;",
);
return response; return response;
} }
@@ -33,7 +37,10 @@ export function middleware(req: NextRequest) {
]; ];
// ST Service 처리 (dc의 /server/dc-service 패턴과 동일) // ST Service 처리 (dc의 /server/dc-service 패턴과 동일)
if (pathname.startsWith("/server/st-management-service") || pathname.startsWith("/server/st-input-service")) { if (
pathname.startsWith("/server/st-management-service") ||
pathname.startsWith("/server/st-input-service")
) {
const requestHeaders = new Headers(req.headers); const requestHeaders = new Headers(req.headers);
const token = req.cookies.get(CLAIM_NAME)?.value; const token = req.cookies.get(CLAIM_NAME)?.value;
const userId = req.cookies.get(AUTH_USER_ID)?.value; const userId = req.cookies.get(AUTH_USER_ID)?.value;
@@ -143,5 +150,10 @@ export function middleware(req: NextRequest) {
} }
export const config = { export const config = {
matcher: ["/server/:path*", "/attach-service/:path*", "/api/link/:path*", "/"], matcher: [
"/server/:path*",
"/attach-service/:path*",
"/api/link/:path*",
"/",
],
}; };
+1 -1
View File
@@ -1,7 +1,7 @@
export const PORT = process.env.NEXT_PUBLIC_PORT || "3000"; export const PORT = process.env.NEXT_PUBLIC_PORT || "3000";
export const PROXY_HOST = export const PROXY_HOST =
process.env.NEXT_PUBLIC_PROXY_HOST || `http://localhost:${PORT}`; process.env.NEXT_PUBLIC_PROXY_HOST || `http://localhost:${PORT}`;
export const SERVER_API_URL = process.env.NEXT_PUBLIC_SERVER_API_URL; export const SERVER_API_URL = process.env.SERVER_API_URL;
export const AUTH_LOGIN_REDIRECT_URL = export const AUTH_LOGIN_REDIRECT_URL =
process.env.NEXT_PUBLIC_AUTH_LOGIN_REDIRECT_URL || "/auth/login"; process.env.NEXT_PUBLIC_AUTH_LOGIN_REDIRECT_URL || "/auth/login";
export const SITE_ID = process.env.NEXT_PUBLIC_SITE_ID || "ST"; export const SITE_ID = process.env.NEXT_PUBLIC_SITE_ID || "ST";