Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const express = require('express');
- const cors = require('cors');
- // CORS middleware
- const allowCrossDomain = function(req, res, next) {
- res.header('Access-Control-Allow-Origin', '*');
- res.header('Access-Control-Allow-Methods', '*');
- res.header('Access-Control-Allow-Headers', '*');
- next();
- }
- const app = express();
- app.use(allowCrossDomain)
Add Comment
Please, Sign In to add comment