adjust api endpoint

This commit is contained in:
lasse 2025-05-27 17:35:12 +02:00
parent a97554bf32
commit e20d0f0524

View File

@ -1,6 +1,9 @@
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 = {
get: <T>(url: string): Promise<{ data: T }> =>