const path = require("path");
const os = require("os");

const DEFAULT_PORT = 5478;

const MASTER_RUNTIME_FILE = path.join(os.tmpdir(), ".comphub", "master.json");

const ADMIN_API = {
  PREFIX: "/__master__",
  HEALTH: "/__master__/health",
  REGISTER: "/__master__/register",
  DEREGISTER: "/__master__/deregister",
  PROJECTS: "/__master__/projects",
  SHUTDOWN: "/__master__/shutdown"
};

const POLL_INTERVAL = 500;
const MAX_RETRIES = 40;
const HTTP_TIMEOUT_GET = 2000;
const HTTP_TIMEOUT_POST = 5000;

module.exports = { DEFAULT_PORT, MASTER_RUNTIME_FILE, ADMIN_API, POLL_INTERVAL, MAX_RETRIES, HTTP_TIMEOUT_GET, HTTP_TIMEOUT_POST };
