From 87dcf53d74fa9acd04281eb0201306f10cfc460d Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Fri, 17 Apr 2026 13:23:26 -0700 Subject: [PATCH] Change default backend port --- README.md | 4 ++-- backend/.env.template | 2 +- backend/Dockerfile | 2 +- backend/README.md | 2 +- backend/src/main.rs | 2 +- frontend/.env.template | 2 +- frontend/README.md | 2 +- frontend/vite.config.ts | 21 ++++++++++++++------- 8 files changed, 22 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 6881056..a37bbbd 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ The rest of the defaults work as-is. `ROBOT_*`, `LIVEKIT_*`, billing, and Stripe cp frontend/.env.template frontend/.env ``` -The defaults (`VITE_API_URL=http://127.0.0.1:3000`) point at the backend and work out of the box. +The defaults (`VITE_API_URL=http://127.0.0.1:2892`) point at the backend and work out of the box. ### 4. Install dependencies and run @@ -62,7 +62,7 @@ cd frontend && bun install && cd .. just dev ``` -This starts the backend (with auto-reload on file changes) at `http://127.0.0.1:3000` and the frontend at `http://127.0.0.1:5173`. +This starts the backend (with auto-reload on file changes) at `http://127.0.0.1:2892` and the frontend at `http://127.0.0.1:5173`. ## Project docs diff --git a/backend/.env.template b/backend/.env.template index a21db77..812fef6 100644 --- a/backend/.env.template +++ b/backend/.env.template @@ -1,6 +1,6 @@ # Server HOST=127.0.0.1 -PORT=3000 +PORT=2892 ALLOW_ORIGINS= # Optional comma-separated allowed CORS origins; empty = permissive # Auth diff --git a/backend/Dockerfile b/backend/Dockerfile index ebd2b23..bedddc8 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -26,6 +26,6 @@ WORKDIR /app COPY --from=build /app/target/release/backend /app/backend -EXPOSE 3000 +EXPOSE 2892 CMD ["/app/backend"] diff --git a/backend/README.md b/backend/README.md index 01e41da..f6bb697 100644 --- a/backend/README.md +++ b/backend/README.md @@ -34,7 +34,7 @@ Environment variables: |---|---|---| | `DATABASE_URL` | SQLite URL. Relative paths are resolved under `backend/`. | `sqlite:///data/caravel.db` | | `HOST` | API bind host (also used for NIP-98 `u` host check) | `127.0.0.1` | -| `PORT` | API bind port | `3000` | +| `PORT` | API bind port | `2892` | | `ADMINS` | Comma-separated admin pubkeys (hex) | _optional_ | | `ALLOW_ORIGINS` | Comma-separated CORS origins. If empty, CORS is permissive. | _optional_ | | `ZOOID_API_URL` | Zooid API base URL used by infra worker | _required for infra sync_ | diff --git a/backend/src/main.rs b/backend/src/main.rs index 336e372..402b80d 100644 --- a/backend/src/main.rs +++ b/backend/src/main.rs @@ -40,7 +40,7 @@ async fn main() -> Result<()> { let port: u16 = std::env::var("PORT") .ok() .and_then(|v| v.parse().ok()) - .unwrap_or(3000); + .unwrap_or(2892); let origins: Vec = std::env::var("ALLOW_ORIGINS") .unwrap_or_default() .split(',') diff --git a/frontend/.env.template b/frontend/.env.template index e28b13e..49f172a 100644 --- a/frontend/.env.template +++ b/frontend/.env.template @@ -1,5 +1,5 @@ # Backend API base URL -VITE_API_URL=http://127.0.0.1:3000 +VITE_API_URL=http://127.0.0.1:2892 # Platform display name shown in UI VITE_PLATFORM_NAME=Caravel diff --git a/frontend/README.md b/frontend/README.md index 5d2d67c..e4ef990 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -32,7 +32,7 @@ Environment variables (see `.env.template`): | Variable | Description | Default | |---|---|---| -| `VITE_API_URL` | Backend API base URL | `http://127.0.0.1:3000` | +| `VITE_API_URL` | Backend API base URL | `http://127.0.0.1:2892` | ## Running diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 5781af2..999aa4b 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -1,13 +1,20 @@ -import { defineConfig } from 'vite' +import { defineConfig, loadEnv } from 'vite' import solid from 'vite-plugin-solid' import tailwindcss from '@tailwindcss/vite' import { fileURLToPath, URL } from 'node:url' -export default defineConfig({ - plugins: [tailwindcss(), solid()], - resolve: { - alias: { - '@': fileURLToPath(new URL('./src', import.meta.url)), +export default defineConfig(({mode}) => { + const env = loadEnv(mode, process.cwd(), '') + + return { + plugins: [tailwindcss(), solid()], + resolve: { + alias: { + '@': fileURLToPath(new URL('./src', import.meta.url)), + }, }, - }, + server: { + port: Number(env.VITE_PORT) || 5173, + }, + } })