adjust api endpoint
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
import { Product, ProductCreate, Shop, ShopCreate, ShoppingEvent, ShoppingEventCreate, Brand, BrandCreate, Grocery, GroceryCreate, GroceryCategory, GroceryCategoryCreate } from '../types';
|
import { Product, ProductCreate, Shop, ShopCreate, ShoppingEvent, ShoppingEventCreate, Brand, BrandCreate, Grocery, GroceryCreate, GroceryCategory, GroceryCategoryCreate } from '../types';
|
||||||
|
|
||||||
const API_BASE_URL = '/api';
|
// Use different API URLs based on environment
|
||||||
|
const API_BASE_URL = process.env.NODE_ENV === 'production'
|
||||||
|
? '/api' // Use nginx proxy in production
|
||||||
|
: 'http://localhost:8000'; // Direct backend connection in development
|
||||||
|
|
||||||
const api = {
|
const api = {
|
||||||
get: <T>(url: string): Promise<{ data: T }> =>
|
get: <T>(url: string): Promise<{ data: T }> =>
|
||||||
|
|||||||
Reference in New Issue
Block a user