NobGit
public anord read

Ledger

Why work hard when you can work easier?

Languages

Repository composition by tracked source files.

TypeScript
TypeScript 86% CSS 10% SQL 3% Shell 1% HTML 0%
Create file Wiki Documentation
Clone
https://nobgit.com/orgs/anord/ledger.git
ssh://[email protected]:2222/orgs/anord/ledger.git

Commit

Fixing domain hosting issue

f388a0d
Alex Nord <[email protected]> 3 months ago
.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,