Refactor API URLs and add environment config example
Replaces hardcoded production API URLs with localhost defaults for local development in both server and client code. Updates Dockerfile to require API URLs via deployment environment variables. Improves ChatTable to use a batch endpoint for chats and unread counts, with backward compatibility. Adds an env.example file to document required environment variables. Updates next.config.mjs to use environment variables for backend API rewrites and image domains.
This commit is contained in:
@@ -30,7 +30,7 @@ export async function GET(req: NextRequest) {
|
||||
|
||||
console.log('Auth check: Token found -', token.substring(0, 15) + '...');
|
||||
|
||||
const apiUrl = process.env.SERVER_API_URL || 'https://internal-api.inboxi.ng/api';
|
||||
const apiUrl = process.env.SERVER_API_URL || 'http://localhost:3001/api';
|
||||
console.log(`Auth check: Calling external API: ${apiUrl}/auth/me`);
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user