What is CORS, and how can you enable it in an Express app?

CORS (Cross-Origin Resource Sharing) allows restricted resources on a web page to be requested from another domain outside the domain from which the first resource was served. To enable CORS in an Express app, you can use the cors middleware:

const cors = require('cors');
app.use(cors()); // Enable all CORS requests