Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions frontend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Backend API base URL
# Override for deployed/staging environments (e.g., PythonAnywhere).
# Defaults to http://127.0.0.1:5000/ for local development.
NEXT_PUBLIC_API_BASE_URL=http://127.0.0.1:5000/
6 changes: 5 additions & 1 deletion frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ yarn-error.log*
.pnpm-debug.log*

# env files (can opt-in for committing if needed)
.env*
.env.example
.env.local
.env.development
.env.production
.env

# vercel
.vercel
Expand Down
3 changes: 2 additions & 1 deletion frontend/services/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import {
SDGClassificationResponse,
} from "@/types/main";

const API_BASE_URL = "http://127.0.0.1:5000/";
const API_BASE_URL =
process.env.NEXT_PUBLIC_API_BASE_URL ?? "http://127.0.0.1:5000/";

const apiClient = axios.create({
baseURL: API_BASE_URL,
Expand Down