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:
@@ -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*',
|
||||
|
||||
Reference in New Issue
Block a user