Guest User

Untitled

a guest
Jul 19th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. const express = require('express');
  2. const cors = require('cors');
  3.  
  4. // CORS middleware
  5. const allowCrossDomain = function(req, res, next) {
  6. res.header('Access-Control-Allow-Origin', '*');
  7. res.header('Access-Control-Allow-Methods', '*');
  8. res.header('Access-Control-Allow-Headers', '*');
  9. next();
  10. }
  11.  
  12. const app = express();
  13. app.use(allowCrossDomain)
Add Comment
Please, Sign In to add comment