{"size": 665, "ext": "js", "max_stars_repo_path": "backend/src/controller/configController.js", "max_stars_repo_name": "Revzik/AGH-MSC_Machine_Analyzer", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "backend/src/controller/configController.js", "max_issues_repo_name": "Revzik/AGH-MSC_Machine_Analyzer", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "backend/src/controller/configController.js", "max_forks_repo_name": "Revzik/AGH-MSC_Machine_Analyzer", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 22.9310344828, "max_line_length": 58, "alphanum_fraction": 0.6691729323}
const log = require("../log/logger")(__filename);
log.info("Setting up config controller");

const express = require("express");
const { config } = require("winston");
const router = express.Router();

const configService = require("../service/configService");

router.get("/", (req, res) => {
  res.json(configService.getConfig());
});

router.post("/", (req, res) => {
  configService.saveConfig(req.body);
  res.sendStatus(200);
});

router.get("/thresholds", (req, res) => {
  res.json(configService.getThresholds());
});

router.post("/thresholds", (req, res) => {
  configService.saveThresholds(req.body);
  res.sendStatus(200);
});

module.exports = router;
