Replace,
app.use(cors({ origin: 'http://localhost:4200', // Allow requests from your frontend methods: 'GET,POST,PUT,DELETE,OPTIONS', allowedHeaders: 'Content-Type,Authorization'
}));
To,
app.use(cors());