public
anord
read
Ledger
Why work hard when you can work easier?
Languages
Repository composition by tracked source files.
TypeScript
86%
CSS
10%
SQL
3%
Shell
1%
HTML
0%
Commit
Fixing domain hosting issue
f388a0d
.env.example | 1 +
apps/web/vite.config.ts | 8 ++++++++
2 files changed, 9 insertions(+)
Diff
diff --git a/.env.example b/.env.example
index 7ca968b..110021f 100644
--- a/.env.example
+++ b/.env.example
@@ -1,6 +1,7 @@
NODE_ENV=development
LEDGER_APP_URL=http://localhost:5173
LEDGER_API_URL=http://localhost:4000
+LEDGER_ALLOWED_HOSTS=localhost,127.0.0.1
VITE_API_URL=
PORT=4000
diff --git a/apps/web/vite.config.ts b/apps/web/vite.config.ts
index 909b995..30a1708 100644
--- a/apps/web/vite.config.ts
+++ b/apps/web/vite.config.ts
@@ -4,11 +4,19 @@ import react from "@vitejs/plugin-react";
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), "");
const apiTarget = env.LEDGER_API_URL || "http://localhost:4000";
+ const allowedHosts =
+ env.LEDGER_ALLOWED_HOSTS === "*"
+ ? true
+ : (env.LEDGER_ALLOWED_HOSTS || "")
+ .split(",")
+ .map((value) => value.trim())
+ .filter(Boolean);
return {
plugins: [react()],
server: {
port: 5173,
+ allowedHosts,
proxy: {
"/api": {
target: apiTarget,