Loading…
Generate CORS policies for various frameworks and servers. Review the result before reusing it in another workflow.
// Express.js CORS Configuration
const cors = require('cors');
const corsOptions = {
origin: '*',
methods: ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
allowedHeaders: ["Content-Type", "Authorization"],
credentials: false,
maxAge: 86400
};
app.use(cors(corsOptions));