<commit_before>let express = require('express');
let router = express.Router();

let Graph = require('./../lib/graph');

router.get('/', function (req, res) {
  if (req.query.project) {
    if (req.session.username && req.session.password && req.session.teamName) {
      let graph = new Graph(req.query.project, 'http://' + req.session.username + ':' +
        req.session.password + '@' + req.session.teamName + '.jamacloud.com/rest/latest/');
      graph.buildGraph(() => {
        res.status(200).json(graph.toJson());
      });
    }
  } else {
    res.render('graph', {
      title: 'JamaTrace',
      subtitle: 'Graph',
      projects: req.session.projects ? req.session.projects : null,
      itemHierarchy: null
    });
  }
});

router.post('/update-hierarchy', function (req, res) {
  console.log('post');
  res.render('partials/hierarchy', { itemHierarchy: req.body }, (err, html) => {
    console.log(err);
    console.log(html);
    if (err){
      console.error(err);
    } else {
      res.status(200).send(html).end();
    }
  });
});

module.exports = router;
<commit_msg>remove post on graph endpoint<commit_after>let express = require('express');
let router = express.Router();

let Graph = require('./../lib/graph');

router.get('/', function (req, res) {
    res.render('graph', {
      title: 'JamaTrace',
      subtitle: 'Graph',
      projects: req.session.projects ? req.session.projects : null,
      itemHierarchy: null
    });
});

router.get('/getGraphData/:id', function (req, res) {
  if (req.session.username && req.session.password && req.session.teamName) {
    let graph = new Graph(req.params.id, 'http://' + req.session.username + ':' +
      req.session.password + '@' + req.session.teamName + '.jamacloud.com/rest/latest/');
    graph.buildGraph(() => {
      res.status(200).json(graph.toJson());
    });
  }
});

module.exports = router;

{'fraction_non_alphanumeric': 0.19638105375199574, 'fraction_numerical': 0.004789781798829164, 'mean_word_length': 3.060475161987041, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6910697', 'n_tokens_mistral': 621, 'n_tokens_neox': 613, 'n_words': 110}