fixes for reading from env

This commit is contained in:
2025-11-07 20:34:47 +05:30
parent 38dc112d0a
commit bff42d0f0b

View File

@@ -33,10 +33,7 @@ interface ArticleContextType {
const ArticleContext = createContext<ArticleContextType | undefined>(undefined);
// You can configure this through an .env or fallback to localhost
const API_BASE =
import.meta?.env?.VITE_API_BASE_URL ||
'http://localhost:8000'; // Matches your OpenAPI "local development server"
const API_BASE = import.meta.env.VITE_API_BASE_URL;
export const ArticleProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {
const [articles, setArticles] = useState<Article[]>([]);