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
|
X
|
||||||
} from 'lucide-react'
|
} from 'lucide-react'
|
||||||
import { adminApi, formatDate, getComplexityColor } from '@/lib/api/admin'
|
import { adminApi, formatDate, getComplexityColor } from '@/lib/api/admin'
|
||||||
|
import { BACKEND_URL } from '@/config/backend'
|
||||||
import { AdminTemplate, AdminStats } from '@/types/admin.types'
|
import { AdminTemplate, AdminStats } from '@/types/admin.types'
|
||||||
import { AdminFeatureSelection } from './admin-feature-selection'
|
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)
|
// 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',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import { Textarea } from "@/components/ui/textarea"
|
|||||||
import { ScrollArea } from "@/components/ui/scroll-area"
|
import { ScrollArea } from "@/components/ui/scroll-area"
|
||||||
import { SelectDevice } from "@/components/ui/select-device"
|
import { SelectDevice } from "@/components/ui/select-device"
|
||||||
import { cn } from "@/lib/utils"
|
import { cn } from "@/lib/utils"
|
||||||
import { getHealthUrl, config } from "@/lib/config"
|
import { getAIMockupHealthUrl, AI_MOCKUP_CONFIG } from "@/lib/api-config"
|
||||||
|
|
||||||
export function PromptSidePanel({
|
export function PromptSidePanel({
|
||||||
className,
|
className,
|
||||||
@ -43,7 +43,7 @@ export function PromptSidePanel({
|
|||||||
const checkBackendStatus = async () => {
|
const checkBackendStatus = async () => {
|
||||||
try {
|
try {
|
||||||
setBackendStatus('checking')
|
setBackendStatus('checking')
|
||||||
const response = await fetch(getHealthUrl(), {
|
const response = await fetch(getAIMockupHealthUrl(), {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
})
|
})
|
||||||
@ -62,7 +62,7 @@ export function PromptSidePanel({
|
|||||||
checkBackendStatus()
|
checkBackendStatus()
|
||||||
|
|
||||||
// Check status every 10 seconds
|
// Check status every 10 seconds
|
||||||
const interval = setInterval(checkBackendStatus, config.ui.statusCheckInterval)
|
const interval = setInterval(checkBackendStatus, AI_MOCKUP_CONFIG.ui.statusCheckInterval)
|
||||||
return () => clearInterval(interval)
|
return () => clearInterval(interval)
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import "@tldraw/tldraw/tldraw.css"
|
|||||||
import { Tldraw, type Editor, createShapeId, toRichText } from "@tldraw/tldraw"
|
import { Tldraw, type Editor, createShapeId, toRichText } from "@tldraw/tldraw"
|
||||||
import { useEffect, useRef, useState } from "react"
|
import { useEffect, useRef, useState } from "react"
|
||||||
import { cn } from "@/lib/utils"
|
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 { useAuth } from "@/contexts/auth-context"
|
||||||
import { getAccessToken } from "@/components/apis/authApiClients"
|
import { getAccessToken } from "@/components/apis/authApiClients"
|
||||||
import { authApiClient, getRefreshToken, setTokens, clearTokens } from "@/components/apis/authApiClients"
|
import { authApiClient, getRefreshToken, setTokens, clearTokens } from "@/components/apis/authApiClients"
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
export const config = {
|
export const config = {
|
||||||
// Backend API configuration
|
// Backend API configuration
|
||||||
backend: {
|
backend: {
|
||||||
baseUrl: process.env.NEXT_PUBLIC_BACKEND_URL || 'http://localhost:8021',
|
baseUrl: process.env.NEXT_PUBLIC_BACKEND_URL || 'http://localhost:8000',
|
||||||
endpoints: {
|
endpoints: {
|
||||||
health: '/health',
|
health: '/health',
|
||||||
generateWireframe: '/generate-wireframe',
|
generateWireframe: '/generate-wireframe',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user