cross-domain.js 328 B

123456789101112
  1. const cors = require('koa2-cors');
  2. module.exports=cors({
  3. origin: function (ctx) {
  4. return '*';
  5. },
  6. exposeHeaders: ['WWW-Authenticate', 'Server-Authorization'],
  7. maxAge: 5,
  8. credentials: true,
  9. allowMethods: ['GET', 'POST', 'DELETE'],
  10. allowHeaders: ['Content-Type', 'Authorization', 'Accept']
  11. });