fixes for reading from env
This commit is contained in:
@@ -33,10 +33,7 @@ interface ArticleContextType {
|
|||||||
|
|
||||||
const ArticleContext = createContext<ArticleContextType | undefined>(undefined);
|
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;
|
||||||
const API_BASE =
|
|
||||||
import.meta?.env?.VITE_API_BASE_URL ||
|
|
||||||
'http://localhost:8000'; // Matches your OpenAPI "local development server"
|
|
||||||
|
|
||||||
export const ArticleProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {
|
export const ArticleProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {
|
||||||
const [articles, setArticles] = useState<Article[]>([]);
|
const [articles, setArticles] = useState<Article[]>([]);
|
||||||
|
|||||||
Reference in New Issue
Block a user