What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-01-22 13:26:56
nextjs Access-Control-Allow-Origin
//npm i cors //# or //yarn add cors import Cors from 'cors' // Initializing the cors middleware const cors = Cors({ methods: ['GET', 'HEAD'], }) // Helper method to wait for a middleware to execute before continuing // And to throw an error when an ... Add solution -
Javascript 2021-08-28 00:03:02
Access to XMLHttpRequest has been blocked by CORS policy node js
/* npm i cors or yarn add cors then in your node app */ const cors = require('cors'); const corsOptions ={ origin:'http://localhost:3000', credentials:true, //access-control-allow-credentials:true optionSuccessStatus:200 } app.use... Add solution