const dayjs = require("dayjs");
let utc = require("dayjs/plugin/utc");
let timezone = require("dayjs/plugin/timezone");

module.exports = {
  token: "",
  codiciNonAccettati: [401, 404],
  setToken(token) {
    this.token = token;
  },
  getToken() {
    return this.token;
  },
  hosts: [],
  setHosts(hosts) {
    this.hosts = hosts;
  },
  getHosts() {
    return this.hosts;
  },
  eventEmitter: {},
  now() {
    dayjs.extend(utc);
    dayjs.extend(timezone);
    dayjs.tz.setDefault(dayjs.tz.guess());
    return dayjs().format("DD/MM/YYYY HH:mm:ss.sss");
  },
};
