chore: fix hono cleint port resolution

This commit is contained in:
d-kimsuon
2025-08-31 17:17:41 +09:00
parent cb6f78f9d5
commit 66c876478e
3 changed files with 6 additions and 4 deletions

2
dist/index.js vendored
View File

@@ -1,5 +1,3 @@
#!/usr/bin/env node
process.env.PORT = "3400";
import "./standalone/server.js";

View File

@@ -11,7 +11,7 @@
},
"scripts": {
"dev": "run-p 'dev:*'",
"dev:next": "next dev -p 3400 --turbopack",
"dev:next": "PORT=3400 next dev --turbopack",
"build": "next build && cp -r public .next/standalone/ && cp -r .next/static .next/standalone/.next/",
"lint": "run-s 'lint:*'",
"lint:biome-format": "biome format .",

View File

@@ -1,4 +1,8 @@
import { hc } from "hono/client";
import type { RouteType } from "../../server/hono/route";
export const honoClient = hc<RouteType>("http://localhost:3400");
export const honoClient = hc<RouteType>(
typeof window === "undefined"
? `http://localhost:${process.env["PORT"] ?? 3000}/`
: "/"
);