Fix backend URL configuration issues - Update all config files to use port 8000 instead of 8021/3001
This commit is contained in:
parent
2264f58f07
commit
1df8ef7380
@ -24,6 +24,7 @@ import {
|
||||
X
|
||||
} from 'lucide-react'
|
||||
import { adminApi, formatDate, getComplexityColor } from '@/lib/api/admin'
|
||||
import { BACKEND_URL } from '@/config/backend'
|
||||
import { AdminTemplate, AdminStats } from '@/types/admin.types'
|
||||
import { AdminFeatureSelection } from './admin-feature-selection'
|
||||
|
||||
@ -137,7 +138,7 @@ export function AdminTemplatesList({ onTemplateSelect }: AdminTemplatesListProps
|
||||
}
|
||||
|
||||
// Call API to create template (you'll need to implement this endpoint)
|
||||
const response = await fetch('/api/templates', {
|
||||
const response = await fetch(`${BACKEND_URL}/api/templates`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
||||
@ -6,7 +6,7 @@ import { Textarea } from "@/components/ui/textarea"
|
||||
import { ScrollArea } from "@/components/ui/scroll-area"
|
||||
import { SelectDevice } from "@/components/ui/select-device"
|
||||
import { cn } from "@/lib/utils"
|
||||
import { getHealthUrl, config } from "@/lib/config"
|
||||
import { getAIMockupHealthUrl, AI_MOCKUP_CONFIG } from "@/lib/api-config"
|
||||
|
||||
export function PromptSidePanel({
|
||||
className,
|
||||
@ -43,7 +43,7 @@ export function PromptSidePanel({
|
||||
const checkBackendStatus = async () => {
|
||||
try {
|
||||
setBackendStatus('checking')
|
||||
const response = await fetch(getHealthUrl(), {
|
||||
const response = await fetch(getAIMockupHealthUrl(), {
|
||||
method: 'GET',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
})
|
||||
@ -62,7 +62,7 @@ export function PromptSidePanel({
|
||||
checkBackendStatus()
|
||||
|
||||
// Check status every 10 seconds
|
||||
const interval = setInterval(checkBackendStatus, config.ui.statusCheckInterval)
|
||||
const interval = setInterval(checkBackendStatus, AI_MOCKUP_CONFIG.ui.statusCheckInterval)
|
||||
return () => clearInterval(interval)
|
||||
}, [])
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@ import "@tldraw/tldraw/tldraw.css"
|
||||
import { Tldraw, type Editor, createShapeId, toRichText } from "@tldraw/tldraw"
|
||||
import { useEffect, useRef, useState } from "react"
|
||||
import { cn } from "@/lib/utils"
|
||||
import { getWireframeGenerationUrl, getWireframeUrl, getWireframeByIdUrl } from "@/lib/config"
|
||||
import { getWireframeGenerationUrl, getWireframeUrl, getWireframeByIdUrl } from "@/lib/api-config"
|
||||
import { useAuth } from "@/contexts/auth-context"
|
||||
import { getAccessToken } from "@/components/apis/authApiClients"
|
||||
import { authApiClient, getRefreshToken, setTokens, clearTokens } from "@/components/apis/authApiClients"
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
export const config = {
|
||||
// Backend API configuration
|
||||
backend: {
|
||||
baseUrl: process.env.NEXT_PUBLIC_BACKEND_URL || 'http://localhost:8021',
|
||||
baseUrl: process.env.NEXT_PUBLIC_BACKEND_URL || 'http://localhost:8000',
|
||||
endpoints: {
|
||||
health: '/health',
|
||||
generateWireframe: '/generate-wireframe',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user