https://www.techiediaries.com/angular-file-upload-progress-bar/
Enable CORS
Since we'll be using Angular served from a different port we'll need to enable CORS in our server.
Open the
src/main.ts
file and call the app.enableCors()
method:import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
app.enableCors();
await app.listen(3000);
}
bootstrap();
You can now send Cross Origin Request from your Angular app to your Nest.js without any problems. In production, you may want to disable CORS