Add WebSocket URL to backend config API - frontend now reads from backend .env
All checks were successful
Build Frontend / Build Frontend (push) Successful in 9s

- Added websocket.url to backend config
- Updated /api/config/public endpoint to return WebSocket URL
- Frontend now fetches WS URL from backend config API
- Falls back to environment variable or auto-generated URL
- Add WS_URL to backend .env: wss://api.turbotrades.dev/ws
This commit is contained in:
2026-01-11 02:01:34 +00:00
parent 0bd3f60627
commit ae18e8b530
2 changed files with 21 additions and 3 deletions

View File

@@ -1,4 +1,5 @@
import SiteConfig from "../models/SiteConfig.js";
import { config as appConfig } from "../config/index.js";
/**
* Public configuration routes
@@ -22,6 +23,11 @@ export default async function configRoutes(fastify, options) {
scheduledEnd: config.maintenance.scheduledEnd,
},
// WebSocket URL
websocket: {
url: appConfig.websocket.url,
},
// Features
features: {
twoFactorAuth: config.features.twoFactorAuth,