260813_01_ENH: http-client에 resolveBaseUrl 적용

This commit is contained in:
2026-08-13 17:12:33 +09:00
parent b57a80814f
commit 266a7d411d
2 changed files with 5 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@kri/create-next-app",
"version": "0.1.5",
"version": "0.1.6",
"description": "Create a KRI standard Next.js application",
"type": "module",
"bin": {

View File

@@ -1,4 +1,7 @@
import { createHttpClient } from "@kri/common/http";
import { clientEnv } from "@/lib/env.client";
export const nextApi = createHttpClient(clientEnv.API_BASE);
const resolveBaseUrl = () =>
typeof window === "undefined" ? clientEnv.API_BASE : new URL(clientEnv.API_BASE, window.location.origin).toString();
export const nextApi = createHttpClient(resolveBaseUrl());