Skip to content

Commit

Permalink
fix env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Anchel123 committed Nov 14, 2024
1 parent 5626cef commit f03f71a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/api/chat/[graph]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
4 changes: 2 additions & 2 deletions app/api/repo/[graph]/[node]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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!,
Expand All @@ -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!,
Expand Down
8 changes: 4 additions & 4 deletions app/api/repo/[graph]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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!,
Expand All @@ -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: {
Expand Down Expand Up @@ -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: {
Expand All @@ -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: {
Expand Down
4 changes: 2 additions & 2 deletions app/api/repo/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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!,
Expand All @@ -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: {
Expand Down

0 comments on commit f03f71a

Please sign in to comment.