all.js 576 B

1234567891011121314151617
  1. var https = require('https');
  2. module.exports = function (req, res, next) {
  3. https.get(`https://api.prprpr.me/count/?id=DIYgod-DPlayer&action=add`);
  4. res.header('Access-Control-Allow-Origin', '*');
  5. res.header('Access-Control-Allow-Headers', 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With , yourHeaderFeild');
  6. res.header('Access-Control-Allow-Methods', 'PUT, POST, GET, DELETE, OPTIONS');
  7. res.header('Cache-control', 'no-cache');
  8. if (req.method == 'OPTIONS') {
  9. res.send(200);
  10. }
  11. else {
  12. next();
  13. }
  14. };