feat: serve the same CRM on crm.montact.ir as an alias

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-15 23:24:50 +03:30
co-authored by Cursor
parent a494b5308e
commit 9611803567
6 changed files with 69 additions and 11 deletions
+6 -1
View File
@@ -17,8 +17,13 @@ async function bootstrap() {
}),
);
const corsRaw = config.get<string>('CORS_ORIGIN') ?? 'http://localhost:5173';
const corsOrigins = corsRaw
.split(',')
.map((origin) => origin.trim())
.filter(Boolean);
app.enableCors({
origin: config.get<string>('CORS_ORIGIN') ?? 'http://localhost:5173',
origin: corsOrigins.length <= 1 ? (corsOrigins[0] ?? 'http://localhost:5173') : corsOrigins,
credentials: true,
});
+1 -1
View File
@@ -49,7 +49,7 @@ export class TrackingService {
publicBaseUrl(): string {
const explicit = this.config.get<string>('PUBLIC_API_BASE_URL')?.trim();
if (explicit) return explicit.replace(/\/$/, '');
const cors = this.config.get<string>('CORS_ORIGIN')?.trim();
const cors = this.config.get<string>('CORS_ORIGIN')?.split(',')[0]?.trim();
if (cors) return `${cors.replace(/\/$/, '')}/api`;
return 'http://localhost:3000/api';
}