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" +} 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) ?? [], + }, + }; }); 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