Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

express cors

// cors install
npm install cors

const cors = require('cors');
app.use(cors()); // if you want to use every domain

const corsOption = {
    origin: ['http://localhost:3000'],
};
app.use(cors(corsOption)); // if you want to use in specific domain
 
PREVIOUS NEXT
Tagged: #express #cors
ADD COMMENT
Topic
Name
4+3 =