diff --git a/app/api/chat/[graph]/route.ts b/app/api/chat/[graph]/route.ts index d6ef73a6..18d4acf6 100644 --- a/app/api/chat/[graph]/route.ts +++ b/app/api/chat/[graph]/route.ts @@ -7,7 +7,7 @@ export async function POST(request: NextRequest, { params }: { params: { graph: const msg = request.nextUrl.searchParams.get('msg') try { - const result = await fetch(`${process.env.BEAKEND_URL}/chat`, { + const result = await fetch(`${process.env.BACKEND_URL}/chat`, { method: 'POST', body: JSON.stringify({ repo: graphName, msg }), headers: { diff --git a/app/api/repo/[graph]/[node]/route.ts b/app/api/repo/[graph]/[node]/route.ts index 4b4f0143..d88397a2 100644 --- a/app/api/repo/[graph]/[node]/route.ts +++ b/app/api/repo/[graph]/[node]/route.ts @@ -6,7 +6,7 @@ export async function GET(request: NextRequest, { params }: { params: { graph: s const graphId = params.graph; try { - const result = await fetch(`${process.env.BEAKEND_URL}/get_neighbors?repo=${graphId}&node_id=${nodeId}`, { + const result = await fetch(`${process.env.BACKEND_URL}/get_neighbors?repo=${graphId}&node_id=${nodeId}`, { method: 'GET', headers: { "Authorization": process.env.SECRET_TOKEN!, @@ -29,7 +29,7 @@ export async function POST(request: NextRequest, { params }: { params: { graph: try { - const result = await fetch(`${process.env.BEAKEND_URL}/find_paths`, { + const result = await fetch(`${process.env.BACKEND_URL}/find_paths`, { method: 'POST', headers: { "Authorization": process.env.SECRET_TOKEN!, diff --git a/app/api/repo/[graph]/route.ts b/app/api/repo/[graph]/route.ts index a4a2dd7e..bceef1a6 100644 --- a/app/api/repo/[graph]/route.ts +++ b/app/api/repo/[graph]/route.ts @@ -5,7 +5,7 @@ export async function GET(request: NextRequest, { params }: { params: { graph: s const graphName = params.graph try { - const result = await fetch(`${process.env.BEAKEND_URL}/graph_entities?repo=${graphName}`, { + const result = await fetch(`${process.env.BACKEND_URL}/graph_entities?repo=${graphName}`, { method: 'GET', headers: { "Authorization": process.env.SECRET_TOKEN!, @@ -32,7 +32,7 @@ export async function POST(request: NextRequest, { params }: { params: { graph: try { switch (type) { case "commit": { - const result = await fetch(`${process.env.BEAKEND_URL}/list_commits`, { + const result = await fetch(`${process.env.BACKEND_URL}/list_commits`, { method: 'POST', body: JSON.stringify({ repo: graphName }), headers: { @@ -212,7 +212,7 @@ export async function POST(request: NextRequest, { params }: { params: { graph: } case "autoComplete": { const prefix = request.nextUrl.searchParams.get('prefix')! - const result = await fetch(`${process.env.BEAKEND_URL}/auto_complete`, { + const result = await fetch(`${process.env.BACKEND_URL}/auto_complete`, { method: 'POST', body: JSON.stringify({ repo: graphName, prefix }), headers: { @@ -230,7 +230,7 @@ export async function POST(request: NextRequest, { params }: { params: { graph: return NextResponse.json({ result: json }, { status: 200 }) } default: { - const result = await fetch(`${process.env.BEAKEND_URL}/repo_info`, { + const result = await fetch(`${process.env.BACKEND_URL}/repo_info`, { method: 'POST', body: JSON.stringify({ repo: graphName }), headers: { diff --git a/app/api/repo/route.ts b/app/api/repo/route.ts index 06d6199c..cf27cd82 100644 --- a/app/api/repo/route.ts +++ b/app/api/repo/route.ts @@ -2,7 +2,7 @@ import { NextRequest, NextResponse } from "next/server"; export async function GET() { try { - const result = await fetch(`${process.env.BEAKEND_URL}/list_repos`, { + const result = await fetch(`${process.env.BACKEND_URL}/list_repos`, { method: 'GET', headers: { "Authorization": process.env.SECRET_TOKEN!, @@ -26,7 +26,7 @@ export async function POST(request: NextRequest) { const url = request.nextUrl.searchParams.get('url'); try { - const result = await fetch(`${process.env.BEAKEND_URL}/process_repo`, { + const result = await fetch(`${process.env.BACKEND_URL}/process_repo`, { method: 'POST', body: JSON.stringify({ repo_url: url, ignore: ["./.github", "./sbin", "./.git", "./deps", "./bin", "./build"] }), headers: {