frontend changes
This commit is contained in:
parent
ea35b0fded
commit
906f763a78
@ -4,13 +4,16 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Main backend URL - change this to update all API calls
|
// Main backend URL - change this to update all API calls
|
||||||
// export const BACKEND_URL = 'http://192.168.1.31:8000';
|
// LIVE PRODUCTION URL (Currently Active)
|
||||||
export const BACKEND_URL = 'https://backend.codenuk.com';
|
export const BACKEND_URL = 'https://backend.codenuk.com';
|
||||||
|
|
||||||
|
// LOCAL DEVELOPMENT URL (Uncomment this and comment above for local development)
|
||||||
|
// export const BACKEND_URL = 'http://localhost:8000';
|
||||||
|
|
||||||
|
|
||||||
// Realtime notifications socket URL (Template Manager emits notifications)
|
// Realtime notifications socket URL (Template Manager emits notifications)
|
||||||
// Prefer env override if present; fallback to local Template Manager port
|
// Uses the same URL as BACKEND_URL for consistency
|
||||||
export const SOCKET_URL = process.env.NEXT_PUBLIC_SOCKET_URL || 'http://localhost:8009';
|
export const SOCKET_URL = BACKEND_URL;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -3,24 +3,26 @@
|
|||||||
* All API base URLs are managed from this single location
|
* All API base URLs are managed from this single location
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Default API base URL - can be overridden by environment variables
|
import { BACKEND_URL } from '@/config/backend';
|
||||||
const DEFAULT_API_BASE_URL = 'http://localhost:8000';
|
|
||||||
|
// Use centralized backend URL
|
||||||
|
const DEFAULT_API_BASE_URL = BACKEND_URL;
|
||||||
|
|
||||||
// Environment-based configuration
|
// Environment-based configuration
|
||||||
export const API_CONFIG = {
|
export const API_CONFIG = {
|
||||||
// Main API base URL
|
// Main API base URL
|
||||||
BASE_URL: process.env.NEXT_PUBLIC_API_URL || DEFAULT_API_BASE_URL,
|
BASE_URL: BACKEND_URL,
|
||||||
|
|
||||||
// Specific service endpoints (if needed in the future)
|
// Specific service endpoints (if needed in the future)
|
||||||
AUTH_SERVICE: process.env.NEXT_PUBLIC_AUTH_API_URL || DEFAULT_API_BASE_URL,
|
AUTH_SERVICE: BACKEND_URL,
|
||||||
TEMPLATE_SERVICE: process.env.NEXT_PUBLIC_TEMPLATE_MANAGER_URL || DEFAULT_API_BASE_URL,
|
TEMPLATE_SERVICE: BACKEND_URL,
|
||||||
GENERATION_SERVICE: process.env.NEXT_PUBLIC_GENERATION_SERVICE_URL || DEFAULT_API_BASE_URL,
|
GENERATION_SERVICE: BACKEND_URL,
|
||||||
SELECTION_SERVICE: process.env.NEXT_PUBLIC_SELECTION_SERVICE_URL || DEFAULT_API_BASE_URL,
|
SELECTION_SERVICE: BACKEND_URL,
|
||||||
|
|
||||||
// AI Mockup Wireframe Service via API Gateway
|
// AI Mockup Wireframe Service via API Gateway
|
||||||
// Route through gateway on port 8000 to unify CORS/auth and service access
|
// Route through gateway on port 8000 to unify CORS/auth and service access
|
||||||
AI_MOCKUP_SERVICE: process.env.NEXT_PUBLIC_BACKEND_URL || 'http://localhost:8000/api/mockup',
|
AI_MOCKUP_SERVICE: `${BACKEND_URL}/api/mockup`,
|
||||||
USER_AUTH_SERVICE: process.env.NEXT_PUBLIC_AUTH_URL || 'http://localhost:8000/api/auth',
|
USER_AUTH_SERVICE: `${BACKEND_URL}/api/auth`,
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
// AI Mockup Configuration
|
// AI Mockup Configuration
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
// Configuration for the wireframe generator
|
// Configuration for the wireframe generator
|
||||||
|
import { BACKEND_URL } from '@/config/backend';
|
||||||
|
|
||||||
export const config = {
|
export const config = {
|
||||||
// Backend API configuration
|
// Backend API configuration
|
||||||
backend: {
|
backend: {
|
||||||
baseUrl: process.env.NEXT_PUBLIC_BACKEND_URL || 'http://localhost:8000',
|
baseUrl: BACKEND_URL,
|
||||||
endpoints: {
|
endpoints: {
|
||||||
health: '/health',
|
health: '/health',
|
||||||
generateWireframe: '/generate-wireframe',
|
generateWireframe: '/generate-wireframe',
|
||||||
@ -18,7 +20,7 @@ export const config = {
|
|||||||
|
|
||||||
// User Authentication Service
|
// User Authentication Service
|
||||||
auth: {
|
auth: {
|
||||||
baseUrl: process.env.NEXT_PUBLIC_AUTH_URL || 'http://localhost:8000',
|
baseUrl: BACKEND_URL,
|
||||||
endpoints: {
|
endpoints: {
|
||||||
health: '/health',
|
health: '/health',
|
||||||
register: '/api/auth/register',
|
register: '/api/auth/register',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user