Update API to env var
All checks were successful
release-image / release-image (push) Successful in 10m59s

This commit is contained in:
Logan Cusano
2025-05-26 17:44:23 -04:00
parent 49c58fd591
commit 0b86cd49cf
7 changed files with 7 additions and 7 deletions

View File

@@ -57,6 +57,7 @@ docker-dev: #docker-build
--rm \
--name $(DOCKER_DEV_CONTAINER_NAME) \
-p 3000:3000 \
-e NEXT_PUBLIC_DRB_BASE_API_URL=$(NEXT_PUBLIC_DRB_BASE_API_URL) \
-v "$(PWD):/app" \
-v "/app/node_modules" \
-e NODE_ENV=development \

View File

@@ -10,7 +10,7 @@ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from '@/components/ui/dialog';
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
import { Checkbox } from '@/components/ui/checkbox';
import { API_BASE_URL } from '@/constants/api';
import { DRB_BASE_API_URL } from '@/constants/api';
import { DiscordId, System, ErrorResponse } from '@/types';
import { authAwareFetch } from '@/utils/AuthAwareFetch';

View File

@@ -3,7 +3,6 @@
import React, { useState, useEffect } from 'react';
import { Button } from '@/components/ui/button';
import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/card';
import { API_BASE_URL } from '@/constants/api';
import { ErrorResponse, NodeStatusResponse, System } from '@/types';
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from '@/components/ui/dialog';
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';

View File

@@ -9,7 +9,7 @@ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from '@/components/ui/dialog';
import { Textarea } from '@/components/ui/textarea';
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
import { API_BASE_URL } from '@/constants/api';
import { DRB_BASE_API_URL } from '@/constants/api';
import { DemodTypes, TalkgroupTag, System, ErrorResponse } from '@/types';
import { authAwareFetch } from '@/utils/AuthAwareFetch';

View File

@@ -1 +1 @@
export const API_BASE_URL = "http://172.16.100.81:5000";
export const DRB_BASE_API_URL: string = process.env.NEXT_PUBLIC_DRB_BASE_API_URL || "http://172.16.100.81:9000";

View File

@@ -8,7 +8,7 @@ import React, {
ReactNode,
useCallback
} from 'react';
import { API_BASE_URL } from '@/constants/api'; // Assuming you have this
import { DRB_BASE_API_URL } from '@/constants/api'; // Assuming you have this
import { authAwareFetch } from '@/utils/AuthAwareFetch'; // Import authAwareFetch
// Define your User and UserRoles types if not already in types.ts

View File

@@ -1,5 +1,5 @@
// utils/AuthAwareFetch.ts
import { API_BASE_URL } from '@/constants/api'; // Make sure this path is correct
import { DRB_BASE_API_URL } from '@/constants/api'; // Make sure this path is correct
interface AuthAwareFetchOptions extends RequestInit {
token?: string;
@@ -20,7 +20,7 @@ export const authAwareFetch = async (
console.log(requestHeaders, rest, url)
const response = await fetch(`${API_BASE_URL}${url}`, {
const response = await fetch(`${DRB_BASE_API_URL}${url}`, {
headers: requestHeaders,
...rest,
});