"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.corsHandling = corsHandling;

// eslint-disable-next-line no-unused-vars
function corsHandling(app, options) {
  app.use((req, res, next) => {
    // console.log('origin', req.get('origin'));
    res.setHeader('Access-Control-Allow-Origin', req.get('origin') || '*'); // res.setHeader('Access-Control-Allow-Origin', req.get('origin'));

    res.setHeader('Access-Control-Allow-Private-Network', true);
    res.setHeader('Access-Control-Allow-Credentials', true);
    next();
  });
  app.options('/*', (req, res) => {
    res.send('Ok');
  });
}