<commit_before>const _ = {
  pick: require('lodash.pick'),
};
const express = require('express');
const fs = require('fs');
const path = require('path');

module.exports = () => {
  const router = new express.Router();
  const version = require('@maxdome/version')();
  router.get('/version', (req, res) => {
    res.send(version);
  });
  let env = process.env;
  try {
    const keys = fs
      .readFileSync(path.join(process.cwd(), '.env.example'), 'utf-8')
      .split('\n')
      .map(line => {
        const matches = line.match(/([A-Z_]*)=.*? #info/);
        if (matches) {
          return matches[1];
        }
      })
      .filter(key => key);
    env = _.pick(env, keys);
  } catch (e) {
    if (e.code !== 'ENOENT') {
      throw e;
    }
  }
  router.get('/env', (req, res) => {
    res.send(env);
  });
  return router;
};<commit_msg>Remove default output of all env vars<commit_after>const _ = {
  pick: require('lodash.pick'),
};
const express = require('express');
const fs = require('fs');
const path = require('path');

module.exports = () => {
  const router = new express.Router();

  const version = require('@maxdome/version')();
  router.get('/version', (req, res) => {
    res.send(version);
  });

  let env = {};
  try {
    const keys = fs
      .readFileSync(path.join(process.cwd(), '.env.example'), 'utf-8')
      .split('\n')
      .map(line => {
        const matches = line.match(/([A-Z_]*)=.*? #info/);
        if (matches) {
          return matches[1];
        }
      })
      .filter(key => key);
    env = _.pick(process.env, keys);
  } catch (e) {
    if (e.code !== 'ENOENT') {
      throw e;
    }
  }
  
  router.get('/env', (req, res) => {
    res.send(env);
  });

  return router;
};
{'fraction_non_alphanumeric': 0.2132564841498559, 'fraction_numerical': 0.0023054755043227667, 'mean_word_length': 2.451292246520875, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '6053992', 'n_tokens_mistral': 607, 'n_tokens_neox': 603, 'n_words': 129}