Change default backend port
This commit is contained in:
@@ -53,7 +53,7 @@ The rest of the defaults work as-is. `ROBOT_*`, `LIVEKIT_*`, billing, and Stripe
|
|||||||
cp frontend/.env.template frontend/.env
|
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
|
### 4. Install dependencies and run
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ cd frontend && bun install && cd ..
|
|||||||
just dev
|
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
|
## Project docs
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Server
|
# Server
|
||||||
HOST=127.0.0.1
|
HOST=127.0.0.1
|
||||||
PORT=3000
|
PORT=2892
|
||||||
ALLOW_ORIGINS= # Optional comma-separated allowed CORS origins; empty = permissive
|
ALLOW_ORIGINS= # Optional comma-separated allowed CORS origins; empty = permissive
|
||||||
|
|
||||||
# Auth
|
# Auth
|
||||||
|
|||||||
+1
-1
@@ -26,6 +26,6 @@ WORKDIR /app
|
|||||||
|
|
||||||
COPY --from=build /app/target/release/backend /app/backend
|
COPY --from=build /app/target/release/backend /app/backend
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 2892
|
||||||
|
|
||||||
CMD ["/app/backend"]
|
CMD ["/app/backend"]
|
||||||
|
|||||||
+1
-1
@@ -34,7 +34,7 @@ Environment variables:
|
|||||||
|---|---|---|
|
|---|---|---|
|
||||||
| `DATABASE_URL` | SQLite URL. Relative paths are resolved under `backend/`. | `sqlite://<backend>/data/caravel.db` |
|
| `DATABASE_URL` | SQLite URL. Relative paths are resolved under `backend/`. | `sqlite://<backend>/data/caravel.db` |
|
||||||
| `HOST` | API bind host (also used for NIP-98 `u` host check) | `127.0.0.1` |
|
| `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_ |
|
| `ADMINS` | Comma-separated admin pubkeys (hex) | _optional_ |
|
||||||
| `ALLOW_ORIGINS` | Comma-separated CORS origins. If empty, CORS is permissive. | _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_ |
|
| `ZOOID_API_URL` | Zooid API base URL used by infra worker | _required for infra sync_ |
|
||||||
|
|||||||
+1
-1
@@ -40,7 +40,7 @@ async fn main() -> Result<()> {
|
|||||||
let port: u16 = std::env::var("PORT")
|
let port: u16 = std::env::var("PORT")
|
||||||
.ok()
|
.ok()
|
||||||
.and_then(|v| v.parse().ok())
|
.and_then(|v| v.parse().ok())
|
||||||
.unwrap_or(3000);
|
.unwrap_or(2892);
|
||||||
let origins: Vec<String> = std::env::var("ALLOW_ORIGINS")
|
let origins: Vec<String> = std::env::var("ALLOW_ORIGINS")
|
||||||
.unwrap_or_default()
|
.unwrap_or_default()
|
||||||
.split(',')
|
.split(',')
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Backend API base URL
|
# 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
|
# Platform display name shown in UI
|
||||||
VITE_PLATFORM_NAME=Caravel
|
VITE_PLATFORM_NAME=Caravel
|
||||||
|
|||||||
+1
-1
@@ -32,7 +32,7 @@ Environment variables (see `.env.template`):
|
|||||||
|
|
||||||
| Variable | Description | Default |
|
| 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
|
## Running
|
||||||
|
|
||||||
|
|||||||
+14
-7
@@ -1,13 +1,20 @@
|
|||||||
import { defineConfig } from 'vite'
|
import { defineConfig, loadEnv } from 'vite'
|
||||||
import solid from 'vite-plugin-solid'
|
import solid from 'vite-plugin-solid'
|
||||||
import tailwindcss from '@tailwindcss/vite'
|
import tailwindcss from '@tailwindcss/vite'
|
||||||
import { fileURLToPath, URL } from 'node:url'
|
import { fileURLToPath, URL } from 'node:url'
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig(({mode}) => {
|
||||||
plugins: [tailwindcss(), solid()],
|
const env = loadEnv(mode, process.cwd(), '')
|
||||||
resolve: {
|
|
||||||
alias: {
|
return {
|
||||||
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
plugins: [tailwindcss(), solid()],
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
server: {
|
||||||
|
port: Number(env.VITE_PORT) || 5173,
|
||||||
|
},
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user