From cd5171960ebf170fd9977df55f52aad4361d6612 Mon Sep 17 00:00:00 2001 From: nakaterm <104970808+nakaterm@users.noreply.github.com> Date: Fri, 19 Jun 2026 14:25:54 +0900 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20dev=20server=20=E3=81=AE=20allowedH?= =?UTF-8?q?osts=20=E3=82=92=E7=92=B0=E5=A2=83=E5=A4=89=E6=95=B0=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit vite.config.ts に直書きしていた allowedHosts を VITE_ALLOWED_HOSTS から 読み込むようにし、個人環境固有のホスト名をコミットせず .env.local で管理できるようにした。 Co-Authored-By: Claude Opus 4.8 --- client/.env.local.sample | 1 + client/vite.config.ts | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/client/.env.local.sample b/client/.env.local.sample index b096a7d..0295f4a 100644 --- a/client/.env.local.sample +++ b/client/.env.local.sample @@ -1,2 +1,3 @@ VITE_API_ENDPOINT=http://localhost:3000 VITE_FRONTEND_ORIGIN=http://localhost:5173 +VITE_ALLOWED_HOSTS= diff --git a/client/vite.config.ts b/client/vite.config.ts index 144359a..362f482 100644 --- a/client/vite.config.ts +++ b/client/vite.config.ts @@ -1,8 +1,14 @@ import tailwindcss from "@tailwindcss/vite"; import react from "@vitejs/plugin-react"; -import { defineConfig } from "vite"; +import { defineConfig, loadEnv } from "vite"; // https://vite.dev/config/ -export default defineConfig({ - plugins: [react(), tailwindcss()], +export default defineConfig(({ mode }) => { + const env = loadEnv(mode, process.cwd(), ""); + return { + plugins: [react(), tailwindcss()], + server: { + allowedHosts: env.VITE_ALLOWED_HOSTS?.split(",").filter(Boolean) ?? [], + }, + }; }); From 59865c9b9a7bd76162be38f3188aa157312a9f8b Mon Sep 17 00:00:00 2001 From: nakaterm <104970808+nakaterm@users.noreply.github.com> Date: Fri, 19 Jun 2026 16:40:52 +0900 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20localhost=E3=82=92=E6=98=8E=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compose.yml b/compose.yml index 20f8f4a..5b3f8bb 100644 --- a/compose.yml +++ b/compose.yml @@ -7,7 +7,7 @@ services: POSTGRES_USER: postgres POSTGRES_PASSWORD: password ports: - - "5432:5432" + - "127.0.0.1:5432:5432" volumes: - postgres_data:/var/lib/postgresql/data From 89e29cd9cceba9949c408ee3bb2848ce98cd5803 Mon Sep 17 00:00:00 2001 From: nakaterm <104970808+nakaterm@users.noreply.github.com> Date: Fri, 19 Jun 2026 16:42:28 +0900 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20ts=20path=E3=82=92=E6=98=8E=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/settings.json | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..512ff90 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "js/ts.tsdk.path": "node_modules/typescript/lib" +}