This commit is contained in:
2026-02-06 02:46:55 +03:00
parent 147d993a05
commit e15ca974fe
3 changed files with 10 additions and 10 deletions

View File

@ -12,14 +12,14 @@ async function bootstrap() {
// Security
app.use(helmet());
// CORS (веб на порту 3125)
// CORS (веб часто на 3000)
const allowedOrigins = [
configService.get('NEXT_PUBLIC_APP_URL'),
'http://localhost:3125',
'http://localhost:3000',
'http://localhost:3125',
].filter(Boolean) as string[];
app.enableCors({
origin: allowedOrigins.length ? allowedOrigins : 'http://localhost:3125',
origin: allowedOrigins.length ? allowedOrigins : 'http://localhost:3000',
credentials: true,
});
@ -50,7 +50,7 @@ async function bootstrap() {
SwaggerModule.setup('docs', app, document);
}
const port = configService.get('PORT') || 3001;
const port = configService.get('PORT') || 3125;
await app.listen(port);
console.log(`🚀 API is running on: http://localhost:${port}/api`);

View File

@ -1,4 +1,4 @@
const API_BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:3001';
const API_BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:3125';
const API_URL = `${API_BASE}/api`;
const STORAGE_KEY = 'coursecraft_api_token';