Complete the code to import the CORS middleware in a NestJS application.
import [1] from 'cors';
The cors package is imported to enable Cross-Origin Resource Sharing middleware.
Complete the code to apply Helmet middleware globally in the NestJS app.
app.use([1]());Helmet is used to secure HTTP headers and is applied as middleware with app.use(helmet()).
Fix the error in enabling CORS with options in the NestJS app.
app.enableCors({ origin: [1] });Setting origin: '*' allows all origins for CORS.
Fill both blanks to import and apply Helmet middleware in main.ts.
import [1] from 'helmet'; app.use([2]());
You import helmet and then apply it with app.use(helmet()).
Fill all three blanks to enable CORS with specific origin and apply Helmet middleware.
app.enableCors({ origin: [1] });
app.use([2]());
app.use([3]());Enable CORS for https://example.com, then apply Helmet and CORS middleware.
