123
This commit is contained in:
@ -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`);
|
||||
|
||||
@ -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';
|
||||
|
||||
Reference in New Issue
Block a user