Skip to content

Commit

Permalink
Merge pull request instructlab#416 from vishnoianil/fix-pathservice
Browse files Browse the repository at this point in the history
Fix path service route to use correct url
  • Loading branch information
Gregory-Pereira authored Dec 12, 2024
2 parents 82619f0 + 1030723 commit f7a3399
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/app/api/tree/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@
import axios from 'axios';
import { NextRequest, NextResponse } from 'next/server';

const DEPLOYMENT = process.env.IL_UI_DEPLOYMENT!;
const EXPERIMENTAL_FEATURES = process.env.NEXT_PUBLIC_EXPERIMENTAL_FEATURES || '';
const ENABLE_DEV_MODE = process.env.IL_ENABLE_DEV_MODE || 'false';

export async function POST(req: NextRequest) {
const body = await req.json();
const { root_path, dir_name } = body;

try {
let apiBaseUrl = 'http://pathservice:4000/tree/';
if (DEPLOYMENT === 'dev' && EXPERIMENTAL_FEATURES !== 'true') {
if (ENABLE_DEV_MODE === 'true') {
apiBaseUrl = 'http://localhost:4000/tree/';
}
const response = await axios.get<string[]>(apiBaseUrl + root_path, {
Expand Down

0 comments on commit f7a3399

Please sign in to comment.