Refactor docs structure and update API env config

Moved documentation files into a new docs/ directory and added a documentation index (docs/README.md). Updated the main README with improved project and documentation details. Set explicit API environment variables in Dockerfile for production. Enhanced next.config.mjs with improved API_BASE_URL handling and logging for better deployment clarity.
This commit is contained in:
NotII
2025-09-01 16:48:42 +01:00
parent 57c2fbdf50
commit 5ce716d2ab
8 changed files with 70 additions and 6 deletions

View File

@@ -24,11 +24,12 @@ const baseConfig = {
],
},
async rewrites() {
const apiBaseUrl = process.env.API_BASE_URL || 'http://localhost:3001';
const apiBaseUrl = process.env.API_BASE_URL;
// Ensure API_BASE_URL is valid to prevent 500 errors
if (!apiBaseUrl || apiBaseUrl === 'undefined') {
console.warn('API_BASE_URL not set, using localhost fallback');
console.warn('⚠️ API_BASE_URL not set! Set it to your backend domain');
console.warn('⚠️ Using localhost fallback - this will fail in production!');
return [
{
source: '/api/:path*',
@@ -37,6 +38,7 @@ const baseConfig = {
];
}
console.log(`🔗 API rewrites pointing to: ${apiBaseUrl}`);
return [
{
source: '/api/:path*',